-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Labels
api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.Issues related to the googleapis/java-bigquerystorage API.
Description
Steps to reproduce
-
Have a BigQuery table with the following field (make sure the
type=NUMERIC):
Field{name=risk_level, type=NUMERIC, mode=null, description=null, policyTags=null, maxLength=null, scale=null, precision=null} -
Use boilerplate code to set up JsonStreamWriter.
-
Call append with an object that has the field above and provide a double. For example:
[{"risk_level":2.3}]
Code example
try {
JSONObject row = new JSONObject().append("risk_level", 2.3);
JSONArray batch = new JSONArray();
batch.put(row);
boilerplateWriteToTable(batch, "project_name");
} catch(Exceptions.AppendSerializtionError e) {
System.out.println(e.getRowIndexToErrorMessage());
throw e;
}Stack trace
getRowIndexToErrorMessage Result:
{0=Field root.risk_level failed to convert to NUMERIC. Error: ByteString scale cannot exceed 9: 2.29999999999999982236431605997495353221893310546875}
Metadata
Metadata
Assignees
Labels
api: bigquerystorageIssues related to the googleapis/java-bigquerystorage API.Issues related to the googleapis/java-bigquerystorage API.