Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit data-type conversion #20

Open
Tracked by #11
kant2002 opened this issue Nov 11, 2023 · 1 comment
Open
Tracked by #11

Implicit data-type conversion #20

kant2002 opened this issue Nov 11, 2023 · 1 comment

Comments

@kant2002
Copy link
Collaborator

kant2002 commented Nov 11, 2023

We need provide support for implicit type conversion, since I can guarantee we will have a lot of pissing of users. Example

CREATE TABLE Data(
   Id int32 not null,
   Code int64 not null
) 

Let's say we will write following query

SELECT * from Data WHERE Id = Code

This may blow up in runtime, since we will write filter approximately like this

let filter row =
    let a = row.Id
    let b = row.Code
    let result = Data.operator == (Int32, Int32)
    result

In this case runtime may properly perform conversion for us, but what about other datatypes? For example string and int comparison, or int and float. float and datetime.

Currently SQL compiler build expression type based on the type of the column and have fixed type for constants. If we wrote rules for the data type conversions, implicit and explicit we should transform original expression and insert casts in the SqlExpression where appropriate.

@kant2002 kant2002 mentioned this issue Nov 11, 2023
32 tasks
@AntyaDev
Copy link
Contributor

I got you. It sounds reasonable but I would delay this functionality since it's not critical for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants