Code Monkey home page Code Monkey logo

Comments (6)

lowka avatar lowka commented on July 23, 2024 1

I updated the issue to make it clear that is not only a problem with literals.

from arrow-datafusion.

lowka avatar lowka commented on July 23, 2024 1

Taking into account the fact that DataFusion’s SqlParserOptions already has an option to specify different Sql dialects (and different dialects process this length/precision parameter in CAST expression differently - see examples below), adding a config parameter seems like a very reasonable approach.

SQLLite:

SELECT CAST('12345' AS VARCHAR(2))
12345

BigQuery:

SELECT CAST('12345' AS STRING(2))
Parameterized types are not allowed in CAST expressions.

from arrow-datafusion.

Lordworms avatar Lordworms commented on July 23, 2024

take

from arrow-datafusion.

alamb avatar alamb commented on July 23, 2024

Maybe we should simply error if DataFusion encouters a type of VARCHAR with an explcit length 🤔 Though if I worry that some people might expect it to work the way it currenty does (ignored)

Perhaps we could make a new configuration setting to control the behavior (error_on_varchar_with_length or something),

from arrow-datafusion.

Lordworms avatar Lordworms commented on July 23, 2024

Maybe we should simply error if DataFusion encouters a type of VARCHAR with an explcit length 🤔 Though if I worry that some people might expect it to work the way it currenty does (ignored)

Perhaps we could make a new configuration setting to control the behavior (error_on_varchar_with_length or something),

Current idea should be adding a new config parameter and when encounter VARCHAR with specific length, we throw an error. Don't know if it works for you @lowka

from arrow-datafusion.

Lordworms avatar Lordworms commented on July 23, 2024

Taking into account the fact that DataFusion’s SqlParserOptions already has an option to specify different Sql dialects (and different dialects process this length/precision parameter in CAST expression differently - see examples below), adding a config parameter seems like a very reasonable approach.

SQLLite:

SELECT CAST('12345' AS VARCHAR(2))
12345

BigQuery:

SELECT CAST('12345' AS STRING(2))
Parameterized types are not allowed in CAST expressions.

Sure, I will do it

from arrow-datafusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.