You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "benj (JIRA)" <ji...@apache.org> on 2019/05/15 14:59:00 UTC

[jira] [Created] (DRILL-7260) Error on clause that should not be evaluated

benj created DRILL-7260:
---------------------------

             Summary: Error on clause that should not be evaluated
                 Key: DRILL-7260
                 URL: https://issues.apache.org/jira/browse/DRILL-7260
             Project: Apache Drill
          Issue Type: Bug
          Components: Query Planning &amp; Optimization
    Affects Versions: 1.16.0
            Reporter: benj


Some requests failed when evaluate condition which should not be evaluated.

Example:
{code:java}
SELECT * FROM (
 SELECT * FROM (
  SELECT '1d28' a ) 
 WHERE regexp_matches(a,'^[0-9]*$')) /* Keep only row on INT format */
WHERE CAST(a AS INT) < 2000;         /* This CAST should't failed due */ 
                                     /* to filtering in the inner queries */
=>
Error: SYSTEM ERROR: NumberFormatException: 1d28
{code}
Note that the problem doesn't appear in all situation.

Examples :
{code:java}
/* Just adding another row and it's work ! */
SELECT * FROM (
 SELECT * FROM (
  SELECT '1d28' a UNION SELECT '2a2')
 WHERE regexp_matches(a,'^[0-9]*$'))
WHERE CAST(a AS INT) < 2000;
=>
+---+
| a |
+---+
+---+
{code}
{code:java}
// MyFile.csvh
a,b
1,2
a1a,3
// !MyFile.csvh 

SELECT * FROM (
 SELECT * FROM ....`MyFile.csvh ` WHERE regexp_matches(a,'^[0-9]*$')) AS x WHERE CAST(a AS INT) < 200;
=>
+---+---+
| a | b |
+---+---+
| 1 | 2 |
+---+---+
{code}
In this case, there is no error - the cast is never evaluated (as expected) for the row with a='a1a'.

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)