question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized Redshift function SPLIT_PART

See original GitHub issue

Search before asking

  • I searched the issues and found no similar issues.

What Happened

My problem is that SPLIT_PART keyword is not recognized for redshift dialect. Here is the function: https://docs.aws.amazon.com/redshift/latest/dg/SPLIT_PART.html

But my actual suggestion would be to have ability to add keywords in config for quick testing and use on production and after try to apply this to main code.

Expected Behaviour

Ability to add keywords in config

Observed Behaviour

I could not find how to quickly fix my issue. Also -- ignore does not work either.

How to reproduce

Any example of using SPLIT_PART: https://docs.aws.amazon.com/redshift/latest/dg/SPLIT_PART.html

Dialect

Redshift

Version

1.2.1

Configuration

[sqlfluff] verbose = 1 dialect = redshift templater = jinja exclude_rules = L003, L033, L031, L042, L066

[sqlfluff:rules] tab_space_size = 2 max_line_length = 300

[sqlfluff:templater:jinja] library_path = sqlfluff_libs

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pdebelakcommented, Aug 4, 2022

Yes, this is the behavior of rule L034, it doesn’t fix if you are using implicit column references at the moment. See https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/rules/L034.py#L160-L166

1reaction
pdebelakcommented, Aug 4, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

SPLIT_PART function - Amazon Redshift
Splits a string on the specified delimiter and returns the part at the specified position.
Read more >
[Amazon](500310) Invalid operation: function split_part ...
I'm trying to run below query in redshift select row_number() over(order by 1) as ...
Read more >
Splitting array of string values into Rows Numbers Table Ref ...
But split_part() expects the third parameter to be an integer and the value isn't implicitly cast. Try to explicitly cast numbers.number .
Read more >
Add support for the PostgreSQL SPLIT_PART function #9038
SPLIT_PART () is supported by some PostgreSQL derived and compatible dialects like PostgreSQL, Redshift, Snowflake, and Vertica. We should ...
Read more >
Amazon Redshift SQL translation guide | BigQuery
Provides a reference to compare statements, functions, data types, and other SQL objects between the Amazon Redshift and Google Standard SQL dialects.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found