Skip to content

Commit 8f9d5de

Browse files
committed
Fixed type mappings when using the Storage Read API
1 parent b7d02a9 commit 8f9d5de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/cdap/plugin/gcp/bigquery/sqlengine/BigQuerySparkDatasetProducer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ private Dataset<Row> convertFieldTypes(Dataset<Row> ds) {
123123
}
124124

125125
// Handle Int types
126-
if (fieldSchema.getType() == Schema.Type.INT && fieldSchema.getLogicalType() == null) {
126+
if (fieldSchema.getType() == Schema.Type.INT) {
127127
LOG.trace("Converting field {} to Integer", fieldName);
128128
ds = ds.withColumn(fieldName, ds.col(fieldName).cast(DataTypes.IntegerType));
129129
}
130130

131131
// Handle float types
132-
if (fieldSchema.getType() == Schema.Type.FLOAT && fieldSchema.getLogicalType() == null) {
132+
if (fieldSchema.getType() == Schema.Type.FLOAT) {
133133
LOG.trace("Converting field {} to Float", fieldName);
134134
ds = ds.withColumn(fieldName, ds.col(fieldName).cast(DataTypes.FloatType));
135135
}

0 commit comments

Comments
 (0)