You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by sr...@apache.org on 2019/02/01 19:38:14 UTC
[samza] branch master updated: SAMZA-2093: make Sql Shell not
depend on result schemas
This is an automated email from the ASF dual-hosted git repository.
srinivasulu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git
The following commit(s) were added to refs/heads/master by this push:
new 4597c58 SAMZA-2093: make Sql Shell not depend on result schemas
new 70bb01e Merge pull request #900 from weiqingy/shellNeedToWork
4597c58 is described below
commit 4597c58bf495f9f08abafa4b7f901d2e57908def
Author: Weiqing Yang <ya...@gmail.com>
AuthorDate: Fri Feb 1 11:17:51 2019 -0800
SAMZA-2093: make Sql Shell not depend on result schemas
---
.../main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java | 8 ++++++--
.../java/org/apache/samza/sql/client/interfaces/QueryResult.java | 5 +++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java b/samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java
index 2cd88b7..73f80e8 100755
--- a/samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java
+++ b/samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java
@@ -175,7 +175,10 @@ public class SamzaExecutor implements SqlExecutor {
executions.put(execId, runner);
LOG.debug("Executing sql. Id ", execId);
- return new QueryResult(execId, generateResultSchema(new MapConfig(staticConfigs)));
+ SqlSchema resultSchema = null;
+ // TODO: after fixing the TODO in generateResultSchema function, we can uncomment the following piece of code.
+ // resultSchema = generateResultSchema(new MapConfig(staticConfigs));
+ return new QueryResult(execId, resultSchema);
}
@Override
@@ -416,7 +419,8 @@ public class SamzaExecutor implements SqlExecutor {
colTypeNames.add(dataTypeField.getType().toString());
}
- // TODO Need to find a way to convert the relational to SQL Schema
+ // TODO: Need to find a way to convert the relational to SQL Schema. After fixing this TODO, please resolve the TODOs
+ // in QueryResult class and executeQuery().
return new SqlSchema(colNames, Collections.emptyList());
}
diff --git a/samza-sql-shell/src/main/java/org/apache/samza/sql/client/interfaces/QueryResult.java b/samza-sql-shell/src/main/java/org/apache/samza/sql/client/interfaces/QueryResult.java
index 7046bf9..bd4ee85 100644
--- a/samza-sql-shell/src/main/java/org/apache/samza/sql/client/interfaces/QueryResult.java
+++ b/samza-sql-shell/src/main/java/org/apache/samza/sql/client/interfaces/QueryResult.java
@@ -30,8 +30,9 @@ public class QueryResult {
private SqlSchema schema; // The schema of the data coming from the query
public QueryResult(int execId, SqlSchema schema) {
- if (schema == null)
- throw new IllegalArgumentException();
+ // TODO: after fixing the TODO in SamzaExecutor.executeQuery(), we can uncomment the following piece of code.
+ /*if (schema == null)
+ throw new IllegalArgumentException();*/
this.execId = execId;
this.schema = schema;
}