EmmyMiao87 opened a new pull request #2730: Ignore the null type when getCmpType
URL: https://github.com/apache/incubator-doris/pull/2730
 
 
   In previous versions, if the children of the IN predicate included NULL, all 
child types would be converted to DOUBLE for calculation.
   For example:
   select * from t1 where k1 in ('TABLE', NULL);
   But children like varchar cannot be converted to double, so the query cannot 
be executed.
   The error is "TABLE is not a number"
   
   The current version, if null exists in the child, it will not enter the 
calculation of compatibility type.
   For the above query, the compatibility type is varchar, so the 'TABLE' is 
not converted to double, and the query could be executed.
   
   Also, for JDBC. It will convert 'show tables;' to :
   ```
   SELECT
   TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME,
    CASE WHEN TABLE_TYPE='BASE TABLE'
    THEN CASE WHEN TABLE_SCHEMA = 'mysql' OR TABLE_SCHEMA = 'performance_schema'
    THEN 'SYSTEM TABLE' ELSE 'TABLE'END WHEN TABLE_TYPE='TEMPORARY'
    THEN 'LOCAL_TEMPORARY' ELSE TABLE_TYPE END AS TABLE_TYPE, TABLE_COMMENT AS 
REMARKS, NULL AS TYPE_CAT, NULL AS TYPE_SCHEM, NULL AS TYPE_NAME, NULL AS 
SELF_REFERENCING_COL_NAME, NULL AS REF_GENERATION
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_SCHEMA LIKE 'test_db'
    AND TABLE_NAME LIKE '%'
    HAVING TABLE_TYPE IN ('TABLE','VIEW',null,null,null)
    ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME
   ```
   In previous version, Doris could not return the correct tables to JDBC. It 
will thrown the error "'TABLE' is not a number".
   After this commit, #2729 is fixed. Doris could return the tables schema by 
JDBC.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to