gauravrkulkarni commented on a change in pull request #1121: Samza-2287:
Removing RegEx based matching while parsing the sql statement
URL: https://github.com/apache/samza/pull/1121#discussion_r309423163
##########
File path:
samza-sql/src/main/java/org/apache/samza/sql/util/SamzaSqlQueryParser.java
##########
@@ -117,7 +113,8 @@ public static QueryInfo parseQuery(String sql) {
sink = sqlInsert.getTargetTable().toString();
if (sqlInsert.getSource() instanceof SqlSelect) {
SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource();
- selectQuery = m.group(2);
+ selectQuery = sqlSelect.toString();
+ LOG.info("Parsed select query {} from sql {}", selectQuery, sql);
sources = getSourcesFromSelectQuery(sqlSelect);
} else {
throw new SamzaException("Sql query is not of the expected format");
Review comment:
nit: not directly related to this PR, but might want to add what the
expected format is in the exception message here and below.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services