Jackie-Jiang commented on a change in pull request #7511:
URL: https://github.com/apache/pinot/pull/7511#discussion_r721787651



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/query/optimizer/statement/JsonStatementOptimizer.java
##########
@@ -387,10 +387,27 @@ private static void optimizeJsonPredicate(Expression 
expression, @Nullable Table
    *  @return A string array containing all the parts of an identifier. An 
identifier may have one or more parts that
    *  are joined together using <DOT>. For example the identifier 
"testTable.jsonColumn.name.first" consists up of
    *  "testTable" (name of table), "jsonColumn" (name of column), "name" (json 
path), and "first" (json path). The last
-   *  two parts when joined together (name.first) represent a JSON path 
expression.
+   *  two parts when joined together (name.first) represent a JSON path 
expression. If an identifier refers to a top-
+   *  level JSON array element (as in column_name[1]), then there is do <DOT> 
in the identifier.
    */
   private static String[] getIdentifierParts(Identifier identifier) {
-    return StringUtils.split(identifier.getName(), '.');
+    String name = identifier.getName();
+
+    // If identifier represents a top level json object then there must be a 
'.' in the identifier name.
+    if (name.indexOf('.') != -1) {

Review comment:
       It should be mapped to `JSON_MATCH(json, '"$[0].a" = 1')`. Notice there 
is no `.` between `$` and `[`. This is standard json path representation




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