Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.16.0
-
None
-
None
Description
Some requests failed when evaluate condition which should not be evaluated.
Example:
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
Note that the problem doesn't appear in all situation.
Examples :
/* 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 | +---+ +---+
// 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 | +---+---+
In this case, there is no error - the cast is never evaluated (as expected) for the row with a='a1a'.