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

feat(query): pre-check cast type #16836

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

andylokandy
Copy link
Collaborator

@andylokandy andylokandy commented Nov 13, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

closes #16790

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Nov 13, 2024
Copy link

what-the-diff bot commented Nov 13, 2024

PR Summary

  • Improved Data Type Conversion Functionality
    We have improved the 'check_cast' function, which is used to convert or translate data from one type to another. This enhancement now allows for more diverse and extra conversion rules among various data types.

  • Incorporated Detailed Scenario Handling
    A comprehensive set of rules (referred to as a match statement) has been designed and implemented to deal with specialized conversion scenarios. This includes the different cases such as 'Null', 'Nullable', 'Array', and 'Map' data types.

  • Enhanced Conversion between 'Variant' and 'Map', and between 'Tuple' types
    The functionality to convert from 'Variant' to 'Map' (with tuple type) and from one 'Tuple' to another 'Tuple' has been added. The only condition for this conversion is that the source and destination tuples should have an equal number of data type components.

  • Robust Error Handling
    In the event of a situation where data conversion is not feasible or supported, our improved error handling mechanisms will produce a detailed, meaningful error message. This feature helps in understanding what went wrong and aids in troubleshooting.

@andylokandy andylokandy requested a review from sundy-li November 13, 2024 13:23
@sundy-li sundy-li changed the title feat: pre-check cast type feat(query): pre-check cast type Nov 14, 2024
@sundy-li
Copy link
Member

please check the ci

@andylokandy andylokandy added this pull request to the merge queue Nov 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2024
@sundy-li
Copy link
Member

sundy-li commented Dec 4, 2024

please add logic tests for the pr.


create table a(t decimal(15,2));
 create table b (t json);


 insert into a select * from b;  --- should fail during binding 

@andylokandy
Copy link
Collaborator Author

seems like insert into a select * from b; will not trigger type_check()...

@sundy-li
Copy link
Member

sundy-li commented Dec 4, 2024

seems like insert into a select * from b; will not trigger type_check()...

TransformCastSchema will trigger

let's use explain pipeline ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: TransformCastSchema need check load_can_auto_cast_to during construction
2 participants