Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ protected CalciteConnectionImpl(Driver driver, AvaticaFactory factory,
}
};
}
this.typeFactory = new JavaTypeFactoryImpl(typeSystem);
if ("com.linkedin.coral.common.HiveTypeSystem".equals(info.get("typeSystem"))) {
this.typeFactory = new CoralJavaTypeFactoryImpl(typeSystem);
} else {
this.typeFactory = new JavaTypeFactoryImpl(typeSystem);
}
}
this.rootSchema =
Objects.requireNonNull(rootSchema != null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.apache.calcite.jdbc;

import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.RelDataTypeSystem;
import org.apache.calcite.rel.type.StructKind;

import java.util.List;

public class CoralJavaTypeFactoryImpl extends JavaTypeFactoryImpl{
public CoralJavaTypeFactoryImpl(RelDataTypeSystem typeSystem) {
super(typeSystem);
}

@Override
public RelDataType createStructType(
final List<RelDataType> typeList,
final List<String> fieldNameList) {
return createStructType(StructKind.PEEK_FIELDS, typeList, fieldNameList);
}
}