Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line comment in query made qtag not recognized. #13

Open
jinfengni opened this issue Aug 7, 2023 · 0 comments
Open

line comment in query made qtag not recognized. #13

jinfengni opened this issue Aug 7, 2023 · 0 comments

Comments

@jinfengni
Copy link
Contributor

Using c style comment, qtag works fine.

cat ~/tmp/q3.sql
select *
from CATALOG_SALES CS
JOIN CUSTOMER C ON (CS.CS_BILL_CUSTOMER_SK = C.C_CUSTOMER_SK)
/* This is comment */
;
-- qtag:references {"table:DIMENSION":true}
cat ~/tmp/q3.sql |qtag
[
  {
    "Source": "references",
    "Key": "table",
    "Value": true,
    "Type": "DIMENSION"
  }
]

Using line comment, qtag is not recognized:

cat ~/tmp/q4.sql
select *
from CATALOG_SALES CS
JOIN CUSTOMER C ON (CS.CS_BILL_CUSTOMER_SK = C.C_CUSTOMER_SK)
-- This is comment
;
-- qtag:references {"table:DIMENSION":true}
cat ~/tmp/q4.sql |qtag
null

Add --all will get qtag, but the line comment mess up with the source name.

cat ~/tmp/q4.sql |qtag --all
[
  {
    "Source": "This is comment\n;\n-- qtag:references",
    "Key": "table:DIMENSION",
    "Value": true,
    "Type": "UNKNOWN"
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant