Skip to content

Commit 99d7ebe

Browse files
committed
Merge branch 'main' into postpone-idempotent-create
2 parents 9f3dd6a + 3712b33 commit 99d7ebe

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

flow/connectors/snowflake/qrep.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,19 @@ func (c *SnowflakeConnector) getColsFromTable(ctx context.Context, tableName str
213213
if colType.String == "FIXED" {
214214
parsedColType = "NUMBER"
215215
}
216+
// Only use precision/scale for numeric types. For other types like TIME/TIMESTAMP,
217+
// the precision field in SHOW COLUMNS refers to fractional seconds, not numeric precision.
218+
precision := numericPrecision.Int32
219+
scale := numericScale.Int32
220+
if parsedColType != "NUMBER" {
221+
precision = 0
222+
scale = 0
223+
}
216224
cols = append(cols, SnowflakeTableColumn{
217225
ColumnName: colName.String,
218226
ColumnType: parsedColType,
219-
NumericPrecision: numericPrecision.Int32,
220-
NumericScale: numericScale.Int32,
227+
NumericPrecision: precision,
228+
NumericScale: scale,
221229
})
222230
}
223231

0 commit comments

Comments
 (0)