morningman commented on code in PR #49209:
URL: https://github.com/apache/doris/pull/49209#discussion_r2009639848
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSExternalTable.java:
##########
@@ -1074,6 +1075,20 @@ public boolean isPartitionedTable() {
public void beforeMTMVRefresh(MTMV mtmv) throws DdlException {
}
+
+ public boolean firstColumnIsString() {
+ List<Column> columns = getColumns();
+ if (columns == null || columns.isEmpty()) {
+ return false;
+ }
+ return columns.get(0).getType().isScalarType(PrimitiveType.STRING);
+ }
+
+ public boolean canReadHiveJsonInOneColumn() {
+ return
ConnectContext.get().getSessionVariable().isReadHiveJsonInOneColumn()
Review Comment:
There is a `sessionVariable` instance in `HiveScanNode`. Use it instead of
`ConnectContext.get().getSessionVariable()`
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/source/HiveScanNode.java:
##########
@@ -413,6 +413,12 @@ public TFileFormatType getFileFormatType() throws
UserException {
if (serDeLib.equals(HiveMetaStoreClientHelper.HIVE_JSON_SERDE)
||
serDeLib.equals(HiveMetaStoreClientHelper.LEGACY_HIVE_JSON_SERDE)) {
type = TFileFormatType.FORMAT_JSON;
+ } else if
(serDeLib.equals(HiveMetaStoreClientHelper.OPENX_JSON_SERDE)) {
+ if (hmsTable.canReadHiveJsonInOneColumn()) {
Review Comment:
I think we should return error if `READ_HIVE_JSON_IN_ONE_COLUMN` is true but
the first column is not string?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]