[ENH] substr() not supported in dask-sql
See original GitHub issueIs your feature request related to a problem? Please describe. I’m working on porting a large set of queries from another engine to dask-sql. I see that I can update the queries to use “substring” instead, but it would be nice if users didn’t have to.
Describe the solution you’d like Can we have substr() supported in dask-sql in the same way that substring() is?
Describe alternatives you’ve considered substring() works in dask-sql not substr(). However, we do not want to alter the sql files by changing substr() to substring()
Additional context Here’s an example query I’d like to be able to run: `import cudf from dask_sql import Context
dc = Context()
df = cudf.DataFrame({'s_c': ['ATX', 'LAX', 'SFO'], 's_d':['38714','37206','38714'],
'd_d':['1900-01-01','1900-01-04','2199-12-28']})
dc.create_table('my_table', df)
query = """
select substr(s_c,1,30)
from
(select s_c
from my_table
where s_d = d_d
group by s_c)
"""
print(dc.sql(query).compute())`
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
SQL Syntax — dask-sql documentation - Read the Docs
Normally, dask-sql calls create a dask data frame, which gets only computed when you call the .compute() member. Due to internal constraints, this...
Read more >dask-sql — dask-sql documentation
dask -sql is a distributed SQL query engine in Python. It allows you to query and transform your data using a mixture of...
Read more >powerful Python data analysis toolkit - pandas
Rolling/Expanding.apply() accepts raw=False to pass a Series to the function ... Pandas Google BigQuery support has moved . ... 1.23.5 SQL .
Read more >Rasa Open Source Change Log
This plugin manager enables the extension and/or enhancement of the Rasa ... POST /model/test/intents : Remove JSON payload option since it is not...
Read more >The Tidelift catalog of open source packages
What is this library? Tidelift works with the maintainers of on & thousands of other projects to deliver support & maintenance for the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for sharing. This confirms @beckernick comment on adding support for the syntax from the java side.
@DaceT On an unrelated note regarding GitHub formatting I notice that you’re using the single backtick (
`
) for code formatting. If you want to format multiline outputs like the one above, you can try using three backticks (```
) instead of one for the formatting around the codeblock. I typically refer to these docs when I can’t recall some of the GitHub formatting rules.SUBSTR
is not part of the default SQL standard. It may need to be enabled on the SqlLibrary enum which is used to create the operator table, though it looks like it should be here via Postgres.