Skip to content

Conversation

@xuyangzhong
Copy link
Contributor

@xuyangzhong xuyangzhong commented Sep 17, 2021

What is the purpose of the change

Get the correct converter which is used to deserialize a decimal field by setting it the correct precision information.

Brief change log

It caused by the different code route between executing actual sql examples and testing test cases. So mainly change the code in TestRowDataCsvInputFormat.

  • Replace the TypeInformation which doesn't contain precision info with DataType which contains.
  • Add some test case in FileSystemITCaseBase

Verifying this change

The test case added can verify this change.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented?

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 2fcfaeb (Fri Sep 17 04:26:19 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 17, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@xuyangzhong
Copy link
Contributor Author

@flinkbot run azure

Copy link
Contributor

@godfreyhe godfreyhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @xuyangzhong , LGTM overall

.collect(Collectors.toList());
RowTypeInfo rowType = (RowTypeInfo) schema.toRowType();
List<TypeInformation> fieldTypeInfos = Arrays.asList(rowType.getFieldTypes());
List<TypeInformation> csvSelectTypeInfos =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this field can be converted to array directly

}

@Test
def testSelectDecimalWithPrecisionTenAndZeroFromFileSystem(): Unit={
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"FromCsv" is more correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because now all test case is in Base, the specific subClass define the implements from avo, csv, json and etc.So if I follow the test behavior before, I think the name "FromFileSystem" is suit for this function. However, if I take this case to "FileSystemTestCsvITCase" or "StreamFileSystemTestCsvITCase", i need to rewrite the same test case twice time(and now subClass that contains these two class doesn't have any test cases at all).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

@xuyangzhong
Copy link
Contributor Author

@flinkbot run azure

1 similar comment
@xuyangzhong
Copy link
Contributor Author

@flinkbot run azure

@xuyangzhong xuyangzhong force-pushed the 210917-flinkjr-24291 branch 2 times, most recently from 765eb79 to 32155a2 Compare September 23, 2021 01:30
@xuyangzhong
Copy link
Contributor Author

@flinkbot run azure

@xuyangzhong
Copy link
Contributor Author

@flinkbot run azure

@godfreyhe godfreyhe closed this in 4d69f7f Oct 9, 2021
godfreyhe pushed a commit to godfreyhe/flink that referenced this pull request Oct 9, 2021
…erializing records from testcsv

This closes apache#17308

(cherry picked from commit 4d69f7f)
godfreyhe pushed a commit to godfreyhe/flink that referenced this pull request Oct 9, 2021
…zing records from testcsv

This closes apache#17308

(cherry picked from commit 4d69f7f)
niklassemmler pushed a commit to niklassemmler/flink that referenced this pull request Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants