[ 
https://issues.apache.org/jira/browse/BEAM-12270?focusedWorklogId=642826&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-642826
 ]

ASF GitHub Bot logged work on BEAM-12270:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Aug/21 13:24
            Start Date: 27/Aug/21 13:24
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on a change in pull request #15361:
URL: https://github.com/apache/beam/pull/15361#discussion_r697409283



##########
File path: 
sdks/java/testing/tpcds/src/main/java/org/apache/beam/sdk/tpcds/QueryReader.java
##########
@@ -37,4 +41,20 @@ public static String readQuery(String queryFileName) throws 
Exception {
     String path = "queries/" + queryFileName + ".sql";
     return Resources.toString(Resources.getResource(path), Charsets.UTF_8);
   }
+
+  /**
+   * Parse query and get all its identifiers.
+   *
+   * @param queryString
+   * @return Set of SQL query identifiers as strings.
+   * @throws SqlParseException
+   */
+  public static Set<String> getQueryIdentifiers(String queryString) throws 
SqlParseException {
+    SqlParser parser = SqlParser.create(queryString);
+    SqlNode parsedQuery = parser.parseQuery();
+    SqlTransformRunner.SqlIdentifierVisitor sqlVisitor =
+        new SqlTransformRunner.SqlIdentifierVisitor();
+    parsedQuery.accept(sqlVisitor);
+    return sqlVisitor.getIdentifiers();

Review comment:
       oohhh 👍 




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 642826)
    Time Spent: 1h 20m  (was: 1h 10m)

> TPC-DS: add Parquet input support
> ---------------------------------
>
>                 Key: BEAM-12270
>                 URL: https://issues.apache.org/jira/browse/BEAM-12270
>             Project: Beam
>          Issue Type: Improvement
>          Components: testing-tpcds
>            Reporter: Alexey Romanenko
>            Priority: P3
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to