AlbericByte commented on code in PR #16592:
URL: https://github.com/apache/druid/pull/16592#discussion_r1662140080


##########
sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/NestedDataOperatorConversions.java:
##########
@@ -721,26 +721,7 @@ public DruidExpression toDruidExpression(
 
   public static class JsonObjectOperatorConversion implements 
SqlOperatorConversion
   {
-    private static final String FUNCTION_NAME = "json_object";
-    private static final SqlFunction SQL_FUNCTION = OperatorConversions
-        .operatorBuilder(FUNCTION_NAME)
-        
.operandTypeChecker(OperandTypes.variadic(SqlOperandCountRanges.from(1)))
-        .operandTypeInference((callBinding, returnType, operandTypes) -> {
-          RelDataTypeFactory typeFactory = callBinding.getTypeFactory();
-          for (int i = 0; i < operandTypes.length; i++) {
-            if (i % 2 == 0) {
-              operandTypes[i] = typeFactory.createSqlType(SqlTypeName.VARCHAR);
-              continue;
-            }
-            operandTypes[i] = typeFactory.createTypeWithNullability(
-                typeFactory.createSqlType(SqlTypeName.ANY),
-                true
-            );
-          }
-        })
-        .returnTypeInference(NESTED_RETURN_TYPE_INFERENCE)

Review Comment:
   @kgyrtkirk @cryptoe and @FrankChen021  i try to use the original 
OperatorConversions(not SqlStdOperatorTable.JSON_OBJECT)
   
   and during plan process, original JsonObjectOperatorConversion will add new 
virtualColumn base on the Expression.
   
   but for the BindablesQuery, we have different plan process and not add 
virtualColumn base on the Expression, so it will go to calcite json_object, 
then we have this runtime error for any BindablesQuery which use json_object.
   
   Please let me know your idea, i need your help to fix this issue.



-- 
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]

Reply via email to