Skip to content

Commit fdbf9fa

Browse files
authored
Merge pull request #1021 from data-integrations/fix-storage-read-api-type-mapping
Fixed type mappings when using the Storage Read API
2 parents 747a48a + 8f9d5de commit fdbf9fa

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)