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

[Bugfix] Source should throw exception when data types between StarRocks and Flink mismatch #127

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

Conversation

banmoy
Copy link
Collaborator

@banmoy banmoy commented Sep 26, 2022

What type of PR is this:

  • bugfix
  • feature
  • enhancement
  • refactor
  • others

Which issues of this PR fixes :

Fixes #126

Problem Summary(Required) :

Source connector will receive data in arrow format from StarRocks' BE, and data will be converted to Flink's format according to the type mapping between StarRocks and Flink. In StarRocksSourceFlinkRows#genFlinkRows, DataTypeUtils.map will be used to map StarRocks's type to Flink's type. It use the arrow's MinorType rather than StarRocks' native type. From the row_batch.cpp#convert_to_arrow_type, we can find that StarRocks's native VARCHAR and CHAR will both be converted to arrow's StringType in C++ or MinorType.VARCHAR in Java. So if arrow returns a MinorType.VARCHAR, we can't distinguish it's StarRocks' CHAR or VARCHAR, and DataTypeUtils.map will always map MinorType.VARCHAR to Flink's LogicalTypeRoot.VARCHAR. So if a column whose StarRocks's type is CHAR and Flink's type is VARCHAR, source should throw an exception to tell type incompatibility, but now it can work. We need fix it.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • I have added user document for my new feature or new function

@banmoy banmoy changed the title [Bugfix] Source should throw exception when data types between Flink … [Bugfix] Source should throw exception when data types between StarRocks and Flink mismatch Sep 27, 2022
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

Successfully merging this pull request may close these issues.

Source should throw exception when data types between Flink and StarRocks mismatch
1 participant