Skip to content

Conversation

@XinShuoWang
Copy link
Contributor

@XinShuoWang XinShuoWang commented Dec 10, 2025

In Spark, there is an feature named ignoreCorruptFile, which allows you to using the configuration spark.sql.files.ignoreCorruptFiles to ignore corrupt files while reading data from files.

Bolt has implemented this feature, but the code is not clean. I want to refactor this feature, including below points:

  • Use macro to simplify code and configuration.
  • Adding some unit tests.

@CLAassistant
Copy link

CLAassistant commented Dec 10, 2025

CLA assistant check
All committers have signed the CLA.

@XinShuoWang XinShuoWang marked this pull request as draft December 10, 2025 09:21
@XinShuoWang XinShuoWang force-pushed the refactor_ignore_corrupt_file branch from 6ac583f to 6831f2a Compare December 10, 2025 09:23
@XinShuoWang XinShuoWang changed the title [WIP] Refactor ignoreCorruptFiles Refactor ignoreCorruptFiles Dec 10, 2025
@XinShuoWang XinShuoWang force-pushed the refactor_ignore_corrupt_file branch from 6831f2a to 68bbbad Compare December 22, 2025 06:22
@XinShuoWang XinShuoWang force-pushed the refactor_ignore_corrupt_file branch from 68bbbad to ffed9ba Compare January 16, 2026 08:41
@XinShuoWang XinShuoWang marked this pull request as ready for review January 16, 2026 08:57
@XinShuoWang XinShuoWang force-pushed the refactor_ignore_corrupt_file branch from dc0a970 to 56092cf Compare January 19, 2026 02:56
// preload can fail in async thread, then retry in sync load
if (isAsyncPreloadThread() &&
std::string(e.what()).find(kAsyncPreloadThreadName) !=
std::string::npos) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why std::string(e.what()).find(kAsyncPreloadThreadName) != std::string::npos was removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why std::string(e.what()).find(kAsyncPreloadThreadName) != std::string::npos was removed here?

Ensure that Scan-related errors can be propagated upwards to bolt/connectors/hive/HiveDataSource.cpp and handled, so that the IgnoreCorruptFile-related logic doesn't need to be added in the asynchronous Preload logic.

Comment on lines 38 to 39
const ::testing::TestInfo* test_info =
::testing::UnitTest::GetInstance()->current_test_info();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have gtest dependency in a build without test? Can we wrapper test related logic inside a macro? So that we can avoid gtest dependency in release build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have gtest dependency in a build without test? Can we wrapper test related logic inside a macro? So that we can avoid gtest dependency in release build.

  1. I didn't change the link settings when compile release version, so I think gtest was already linked by default in the original configuration.
  2. I think it's great that you pointed this out, and I will try to remove the gtest dependency here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have gtest dependency in a build without test? Can we wrapper test related logic inside a macro? So that we can avoid gtest dependency in release build.

I have completed the modifications in this commit:7d4c8b1

Copy link
Collaborator

@zhangxffff zhangxffff left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxinshuo-bolt wangxinshuo-bolt merged commit 800d129 into bytedance:main Jan 19, 2026
8 checks passed
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.

4 participants