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.

[ENH] substr() not supported in dask-sql

See original GitHub issue

Is 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:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ayushdgcommented, Oct 15, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

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