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

Hive: fix incorrect L027 error for rowtype attribute name #2893

Merged
merged 2 commits into from
Mar 21, 2022

Conversation

KulykDmytro
Copy link
Contributor

@KulykDmytro KulykDmytro commented Mar 21, 2022

In Hive dialect there is a false positive violation detected in rowtype definition when query/subquery operates with join

select cast(row(t1.attr, t2.attr) as row(fld1 double, fld2 double)) as flds
from sch.tab1 as t1
join sch.tab2 as t2 on t2.id = t1.id

fld1, fld2 interpret as table column alias rather than rowtype attribute name

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

One nit on the comment.

test/fixtures/rules/std_rule_cases/L027.yml Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #2893 (16a7609) into main (5b45e2a) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #2893   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          163       163           
  Lines        12660     12660           
=========================================
  Hits         12660     12660           
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_hive.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b45e2a...16a7609. Read the comment docs.

@tunetheweb tunetheweb merged commit 1991c62 into sqlfluff:main Mar 21, 2022
@tunetheweb tunetheweb changed the title Hive: fix to align with L027 rule (rowtype attribute name) Hive: fix incorrect L027 error for rowtype attribute name Mar 21, 2022
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

Successfully merging this pull request may close these issues.

2 participants