-
Notifications
You must be signed in to change notification settings - Fork 37
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
fix(core): fix the remote column inferring and disable simplify expression rule #874
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
core
ibis
rust
Pull requests that update Rust code
python
Pull requests that update Python code
labels
Oct 31, 2024
goldmedal
changed the title
fix(core) fix the remote column inferring and disable simplify expression rule
fix(core): fix the remote column inferring and disable simplify expression rule
Oct 31, 2024
grieve54706
approved these changes
Oct 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@goldmedal Could you check the transformed SQL is changed for Postgres? |
The planned SQL is SELECT
orders."timestamp",
orders."timestamptz",
orders.order_cust_key,
orders.o_custkey,
orders.o_orderdate,
orders.o_orderkey,
orders.o_orderstatus,
orders.o_totalprice
FROM
(
SELECT
CAST(
'2024-01-01T23:59:59' AS TIMESTAMP
) AS "timestamp",
CAST(
'2024-01-01T23:59:59' AS TIMESTAMP WITH TIME ZONE
) AS "timestamptz",
concat(
CAST(
public.orders.o_orderkey AS VARCHAR
),
'_',
CAST(
public.orders.o_custkey AS VARCHAR
)
) AS order_cust_key,
public.orders.o_custkey AS o_custkey,
public.orders.o_orderdate AS o_orderdate,
public.orders.o_orderkey AS o_orderkey,
public.orders.o_orderstatus AS o_orderstatus,
public.orders.o_totalprice AS o_totalprice
FROM
public.orders
) AS orders
LIMIT
1 The dialect SQL is SELECT
orders."timestamp",
orders."timestamptz",
orders.order_cust_key,
orders.o_custkey,
orders.o_orderdate,
orders.o_orderkey,
orders.o_orderstatus,
orders.o_totalprice
FROM
(
SELECT
CAST(
'2024-01-01T23:59:59' AS TIMESTAMP
) AS "timestamp",
CAST(
'2024-01-01T23:59:59' AS TIMESTAMPTZ
) AS "timestamptz",
CONCAT(
CAST(
public.orders.o_orderkey AS VARCHAR
),
'_',
CAST(
public.orders.o_custkey AS VARCHAR
)
) AS order_cust_key,
public.orders.o_custkey AS o_custkey,
public.orders.o_orderdate AS o_orderdate,
public.orders.o_orderkey AS o_orderkey,
public.orders.o_orderstatus AS o_orderstatus,
public.orders.o_totalprice AS o_totalprice
FROM
public.orders
) AS orders
LIMIT
1 It seems to generate |
grieve54706
pushed a commit
that referenced
this pull request
Nov 1, 2024
grieve54706
pushed a commit
that referenced
this pull request
Dec 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixed multiple issues.
Disable
SimplifyExpressionRule
This rule will simplify an expression to another expression if it can be evaluated. For example,
current_date
would be simplified to the real value likeCAST('2024-10-31' DATE)
. However, we should execute this function on the DataSource side to make sure the time or timezone issue can be aligned.Fix the Remote Column inferring
The remote column has some bugs. I missed to apply this way when generating the
ModelSourceNode
.Fix the
isHidden
fieldWe always serialize the field name using
camelCase
style.