Skip to content

Commit

Permalink
Map json to String (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
Novemser authored and ilovesoup committed Mar 12, 2018
1 parent 0ef80af commit 5ce1350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/sql/TiStrategy.scala
Expand Up @@ -61,7 +61,7 @@ class TiStrategy(context: SQLContext) extends Strategy with Logging {

def typeBlackList: TypeBlacklist = {
val blacklistString =
sqlConf.getConfString(TiConfigConst.UNSUPPORTED_TYPES, "time,enum,set,year")
sqlConf.getConfString(TiConfigConst.UNSUPPORTED_TYPES, "time,enum,set,year,json")
new TypeBlacklist(blacklistString)
}

Expand Down
Expand Up @@ -24,6 +24,8 @@
import java.lang.reflect.Constructor;
import java.util.Map;

import static com.pingcap.tikv.types.MySQLType.TypeJSON;

public class DataTypeFactory {
private static final Map<MySQLType, Constructor<? extends DataType>> dataTypeCreatorMap;
private static final Map<MySQLType, DataType> dataTypeInstanceMap;
Expand All @@ -43,6 +45,7 @@ public class DataTypeFactory {
extractTypeMap(EnumType.subTypes, EnumType.class, builder, instBuilder);
extractTypeMap(SetType.subTypes, SetType.class, builder, instBuilder);
extractTypeMap(YearType.subTypes, YearType.class, builder, instBuilder);
extractTypeMap(new MySQLType[]{MySQLType.TypeJSON}, StringType.class, builder, instBuilder);
dataTypeCreatorMap = builder.build();
dataTypeInstanceMap = instBuilder.build();
}
Expand Down

0 comments on commit 5ce1350

Please sign in to comment.