Repository: reata/sqllineage (python)

Issue:
column lineages from boolean expression
I have problems with some queries which contain boolean expressions (exasol-db). I only use the LineageRunner(sql_statement).get_column_lineage()-function without the gui.

The column lineages ignore the second boolean field (IS_CASE_TWO).
```
CREATE VIEW VIEW_A AS
SELECT
    TABLE_ID,
    NUMBER_01 + NUMBER_02 > 0 AS IS_CASE_ONE,
    (NUMBER_01 + NUMBER_02 > 0 AND NUMBER_03 + NUMBER_04 <= 0) AS IS_CASE_TWO
FROM
    TABLE_A
```


It is possible the following query parse with version 1.3.3. This ignore the timestamp fields in boolean expressions.
```
CREATE VIEW VIEW_B AS
SELECT
    TABLE_ID,
    (
        FIRST_TIMESTAMP IS NOT NULL
        AND FIRST_TIMESTAMP >= TO_TIMESTAMP(ADD_DAYS(CURRENT_DATE, -100))
        AND OTHER_TIMESTAMP > TO_TIMESTAMP(ADD_YEARS(CURRENT_DATE, -7))
    ) AS IS_QUALIFIED
FROM
    TABLE_B
```
I get in version 1.3.4 to many column lineages, like TABLE_B.IS -> IS_QUALIFIED or TABLE_B.NOT NULL -> IS_QUALIFIED.



Pull request:
fix: column lineage using boolean expression
Closes #236 

Patch:
diff --git a/sqllineage/core/models.py b/sqllineage/core/models.py
index 93a0af0..9dd1821 100644
--- a/sqllineage/core/models.py
+++ b/sqllineage/core/models.py
@@ -304,16 +304,12 @@ class Column:
                     ColumnQualifierTuple(token.get_real_name(), token.get_parent_name())
                 ]
         else:
-            # Handle literals other than *
-            if (
-                token.ttype is not None
-                and token.ttype[0] == T.Literal[0]
-                and token.value != "*"
-            ):
-                source_columns = []
-            else:
+            if token.ttype == T.Wildcard:
                 # select *
                 source_columns = [ColumnQualifierTuple(token.value, None)]
+            else:
+                # typically, T.Literal here
+                source_columns = []
         return source_columns
 
     def to_source_columns(self, alias_mapping: Dict[str, Union[Table, SubQuery]]):


Test patch:
diff --git a/tests/test_columns.py b/tests/test_columns.py
index 1885d6f..892034d 100644
--- a/tests/test_columns.py
+++ b/tests/test_columns.py
@@ -228,6 +228,25 @@ FROM tab2"""
     )
 
 
+def test_select_column_using_boolean_expression_in_parenthesis():
+    sql = """INSERT OVERWRITE TABLE tab1
+SELECT (col1 > 0 AND col2 > 0) AS col3
+FROM tab2"""
+    assert_column_lineage_equal(
+        sql,
+        [
+            (
+                ColumnQualifierTuple("col1", "tab2"),
+                ColumnQualifierTuple("col3", "tab1"),
+            ),
+            (
+                ColumnQualifierTuple("col2", "tab2"),
+                ColumnQualifierTuple("col3", "tab1"),
+            ),
+        ],
+    )
+
+
 def test_select_column_using_expression_with_table_qualifier_without_column_alias():
     sql = """INSERT OVERWRITE TABLE tab1
 SELECT a.col1 + a.col2 + a.col3 + a.col4