deniskuzZ commented on code in PR #5541:
URL: https://github.com/apache/hive/pull/5541#discussion_r1907443106
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -16089,7 +16097,26 @@ protected void
addPartitionColsToInsert(List<FieldSchema> partCols,
rewrittenQueryStr.append(")");
}
}
-
+
+ private String getSortOrderJson(ASTNode ast) {
+ List<SortFieldDesc> sortFieldDescList = new ArrayList<>();
+ SortFields sortFields = new SortFields(sortFieldDescList);
+ for (int i = 0; i < ast.getChildCount(); i++) {
+ ASTNode child = (ASTNode) ast.getChild(i);
+ SortFieldDesc.SortDirection sortDirection = child.getToken()
+ .getType() == HiveParser.TOK_TABSORTCOLNAMEDESC ?
SortFieldDesc.SortDirection.DESC : SortFieldDesc.SortDirection.ASC;
+ child = (ASTNode) child.getChild(0);
+ String name =
unescapeIdentifier(child.getChild(0).getText()).toLowerCase();
+ SortFieldDesc.NullOrder nullOrder = child.getToken().getType() ==
HiveParser.TOK_NULLS_FIRST ? SortFieldDesc.NullOrder.NULLS_FIRST :
SortFieldDesc.NullOrder.NULLS_LAST;
+ sortFieldDescList.add(new SortFieldDesc(name, sortDirection, nullOrder));
+ }
+ try {
+ return jsonObjectMapper.writeValueAsString(sortFields);
Review Comment:
is there a reason why we use `jsonObjectMapper` and not byte serialization
like
````
serializedFilterExpr =
SerializationUtilities.serializeExpression(filterExpr)
````
or
````
jobConf.set(TableScanDesc.PARTITION_PRUNING_FILTER,
SerializationUtilities.serializeExpression(prunerExpr));
````
--
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]