Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T-SQL: Parse
DATEPART
date type as date type instead of column name (…
…#3681) Co-authored-by: Greg Finley <gregory.finley@gmail.com> Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
- Loading branch information
1 parent
7a40bf6
commit 3030af7
Showing
5 changed files
with
83 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SELECT DATEPART(DW, my_table.date) AS dayofweek | ||
FROM my_table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# YML test files are auto-generated from SQL files and should not be edited by | ||
# hand. To help enforce this, the "hash" field in the file must match a hash | ||
# computed by SQLFluff when running the tests. Please run | ||
# `python test/generate_parse_fixture_yml.py` to generate them after adding or | ||
# altering SQL files. | ||
_hash: 6178c02c375d73445a741139a586236270723a4390dbdd51c1f7b58d1a9b9f6c | ||
file: | ||
batch: | ||
statement: | ||
select_statement: | ||
select_clause: | ||
keyword: SELECT | ||
select_clause_element: | ||
function: | ||
function_name: | ||
function_name_identifier: DATEPART | ||
bracketed: | ||
start_bracket: ( | ||
date_part: DW | ||
comma: ',' | ||
expression: | ||
column_reference: | ||
- identifier: my_table | ||
- dot: . | ||
- identifier: date | ||
end_bracket: ) | ||
alias_expression: | ||
keyword: AS | ||
identifier: dayofweek | ||
from_clause: | ||
keyword: FROM | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
identifier: my_table | ||
statement_terminator: ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters