Skip to content

Commit

Permalink
update geo type
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoXuAI committed May 12, 2023
1 parent c224f49 commit 98f4ecf
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;

@Slf4j
public class SnowflakeTypeMapper implements JdbcDialectTypeMapper {
Expand Down Expand Up @@ -111,11 +112,19 @@ public SeaTunnelDataType<?> mapping(ResultSetMetaData metadata, int colIndex)
case SNOWFLAKE_TEXT:
case SNOWFLAKE_VARIANT:
case SNOWFLAKE_OBJECT:
case SNOWFLAKE_GEOMETRY:
return BasicType.STRING_TYPE;
case SNOWFLAKE_GEOGRAPHY:
case SNOWFLAKE_GEOMETRY:
int geoMetaType = metadata.getColumnType(colIndex);
switch (geoMetaType) {
case Types.BINARY:
return PrimitiveByteArrayType.INSTANCE;
case Types.VARCHAR:
default:
return BasicType.STRING_TYPE;
}
case SNOWFLAKE_BINARY:
case SNOWFLAKE_VARBINARY:
case SNOWFLAKE_GEOGRAPHY:
return PrimitiveByteArrayType.INSTANCE;
case SNOWFLAKE_DATE:
return LocalTimeType.LOCAL_DATE_TYPE;
Expand Down

0 comments on commit 98f4ecf

Please sign in to comment.