Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1714#discussion_r80442067
  
    --- 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. 
    Yes CAST is required because the type of looked up value is Object. While 
we're saying based on only type on runtime, we might need to consider the type 
on schema.
    
    2. 
    Implicit cast is not possible because we can't determine the value type on 
compile time, especially we use ANY to represent its type.


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

Reply via email to