Github user arunmahadevan commented on a diff in the pull request:
https://github.com/apache/storm/pull/1714#discussion_r80414653
--- Diff:
external/sql/storm-sql-core/src/test/org/apache/storm/sql/TestStormSql.java ---
@@ -174,26 +173,42 @@ public void testExternalDataSource() throws Exception
{
public void testExternalDataSourceNested() throws Exception {
List<String> stmt = new ArrayList<>();
stmt.add("CREATE EXTERNAL TABLE FOO (ID INT, MAPFIELD ANY,
NESTEDMAPFIELD ANY, ARRAYFIELD ANY) LOCATION 'mocknested:///foo'");
- stmt.add("SELECT STREAM ID, MAPFIELD, NESTEDMAPFIELD, ARRAYFIELD " +
+ stmt.add("SELECT STREAM ID, MAPFIELD['c'], NESTEDMAPFIELD, ARRAYFIELD
" +
"FROM FOO " +
- "WHERE NESTEDMAPFIELD['a']['b'] = 2 AND ARRAYFIELD[1]
= 200");
+ "WHERE CAST(MAPFIELD['b'] AS INTEGER) = 2 AND
CAST(ARRAYFIELD[1] AS INTEGER) = 200");
--- End diff --
1. Is the CAST required since the linq4j does type cast the result in the
generated code ?
2. Is it not possible to support Multi-dimensional array/map lookups with
the new implementation? Can we have storm-sql generate code for CAST and
delegate the rest to calcite and keep the earlier syntax ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---