-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-bigquery API.
Description
ResultSet getXXX returns default value instead of null for nullable fields.
BigQueryResultImpl implementation of getBoolean, getDouble, getLong should return null the same as others methods
Data (See row 4)
private fun ResultSet.getFieldValue(field: Field): Any? {
val fieldName = field.name
return when (field.type.standardType) {
StandardSQLTypeName.BOOL -> getBoolean(fieldName)
StandardSQLTypeName.INT64 -> getLong(fieldName)
StandardSQLTypeName.FLOAT64 -> getDouble(fieldName)
StandardSQLTypeName.NUMERIC, StandardSQLTypeName.BIGNUMERIC -> getBigDecimal(fieldName)
StandardSQLTypeName.STRING -> getString(fieldName)
StandardSQLTypeName.BYTES -> getBytes(fieldName)
StandardSQLTypeName.TIMESTAMP -> getTimestamp(fieldName)?.toInstant()
StandardSQLTypeName.DATE -> getDate(fieldName)?.toLocalDate()?.atStartOfDay()?.toInstant(ZoneOffset.UTC)
StandardSQLTypeName.GEOGRAPHY -> getString(fieldName)?.toByteArray(StandardCharsets.UTF_8)
StandardSQLTypeName.JSON -> getString(fieldName)
StandardSQLTypeName.INTERVAL -> getObject(fieldName)
StandardSQLTypeName.RANGE -> getObject(fieldName)
else -> getObject(fieldName)
}
}Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-bigquery API.
