Skip to content

Commit 53ba468

Browse files
[Refactor] Split ORC format code into FormatOrc module (#74836)
Signed-off-by: alvin-phoenix-ai <alvin.zhao@phoenixdata.ai>
1 parent c0a774b commit 53ba468

14 files changed

Lines changed: 42 additions & 16 deletions

File tree

be/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Core runtime building blocks without full Runtime/Exec/Storage coupling.
177177
### FormatCore (`formatcore`)
178178
Format-oriented core primitives above ComputeEnv, ExprCore, RuntimeCore, FSCore, ChunkCore, ColumnCore, and Types.
179179
- Targets: `FormatCore`
180-
- Allowed internal include prefixes: `formats/column_evaluator.h`, `formats/disk_range.hpp`, `formats/file_writer.h`, `formats/io/`, `formats/utils.h`, `exprs/`, `runtime/`, `fs/`, `column/`, `types/`, `common/`, `base/`, `gutil/`, `gen_cpp/`
180+
- Allowed internal include prefixes: `formats/column_evaluator.h`, `formats/deletion_bitmap.h`, `formats/disk_range.hpp`, `formats/file_writer.h`, `formats/io/`, `formats/utils.h`, `exprs/`, `runtime/`, `fs/`, `column/`, `types/`, `common/`, `base/`, `gutil/`, `gen_cpp/`
181181
- Allowed target deps: `ComputeEnv`, `ExprCore`, `RuntimeCore`, `FSCore`, `ChunkCore`, `ColumnCore`, `Types`, `Common`, `Base`, `Gutil`, `StarRocksGen`
182182
- Core tests: `format_test`
183183
- Remediation: Keep FormatCore limited to reusable format primitives; move connector orchestration and higher execution policy upward.

be/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,11 @@ set(STARROCKS_LINK_LIBS
551551
Udf
552552
Util
553553
Script
554-
orc
555554
${WL_END_GROUP}
556555
FormatAvro
557556
FormatCsv
558557
FormatJson
558+
FormatOrc
559559
FormatCore
560560
ExecRuntime
561561
ComputeEnv

be/module_boundary_manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,15 @@
315315
"owned_targets": ["FormatCore"],
316316
"owned_globs": [
317317
"be/src/formats/column_evaluator.*",
318+
"be/src/formats/deletion_bitmap.*",
318319
"be/src/formats/disk_range.hpp",
319320
"be/src/formats/file_writer.*",
320321
"be/src/formats/io/**",
321322
"be/src/formats/utils.h"
322323
],
323324
"allowed_include_prefixes": [
324325
"formats/column_evaluator.h",
326+
"formats/deletion_bitmap.h",
325327
"formats/disk_range.hpp",
326328
"formats/file_writer.h",
327329
"formats/io/",
@@ -351,6 +353,7 @@
351353
],
352354
"allowed_test_targets": ["format_test"],
353355
"allowed_test_link_deps": [
356+
"FormatOrc",
354357
"FormatAvro",
355358
"FormatJson",
356359
"FormatCsv",

be/src/connector/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ ADD_BE_LIB(Connector
5252
partition_chunk_writer.cpp
5353
connector_sink_executor.cpp
5454
deletion_vector/deletion_vector.cpp
55-
deletion_vector/deletion_bitmap.cpp
5655
iceberg_delete_sink.cpp
5756
iceberg_row_delta_sink.cpp
5857
)

be/src/connector/deletion_vector/deletion_vector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "base/string/base85.h"
2020
#include "base/uuid/uuid_generator.h"
2121
#include "common/config_scan_io_fwd.h"
22-
#include "deletion_bitmap.h"
22+
#include "formats/deletion_bitmap.h"
2323

2424
namespace starrocks {
2525

be/src/exec/hdfs_scanner/hdfs_scanner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
#include "cache/scan/shared_buffered_input_stream.h"
2323
#include "column/column_access_path.h"
2424
#include "common/runtime_profile.h"
25-
#include "connector/deletion_vector/deletion_bitmap.h"
2625
#include "exec/olap_scan_prepare.h"
2726
#include "exec/pipeline/scan/morsel.h"
2827
#include "exec/pipeline/scan/scan_morsel.h"
2928
#include "exec/runtime_filter/runtime_filter_probe.h"
3029
#include "exprs/expr.h"
3130
#include "exprs/expr_context.h"
31+
#include "formats/deletion_bitmap.h"
3232
#include "fs/fs.h"
3333
#include "runtime/descriptors.h"
3434
#include "runtime/runtime_state_fwd.h"

be/src/exec/paimon/paimon_delete_file_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <bitset>
2121

2222
#include "base/container/raw_container.h"
23-
#include "connector/deletion_vector/deletion_bitmap.h"
23+
#include "formats/deletion_bitmap.h"
2424

2525
namespace starrocks {
2626

be/src/formats/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/src/formats")
1616

1717
ADD_BE_LIB(FormatCore
1818
column_evaluator.cpp
19+
deletion_bitmap.cpp
1920
disk_range.hpp
2021
file_writer.cpp
2122
io/async_flush_output_stream.cpp
@@ -90,7 +91,7 @@ ADD_BE_LIB(FormatAvro
9091

9192
target_link_libraries(FormatAvro PUBLIC FormatCore)
9293

93-
ADD_BE_LIB(Formats
94+
ADD_BE_LIB(FormatOrc
9495
orc/orc_chunk_reader.cpp
9596
orc/orc_file_writer.cpp
9697
orc/orc_input_stream.cpp
@@ -103,6 +104,11 @@ ADD_BE_LIB(Formats
103104
orc/column_reader.cpp
104105
orc/memory_stream/MemoryInputStream.cc
105106
orc/memory_stream/MemoryOutputStream.cc
107+
)
108+
109+
target_link_libraries(FormatOrc PUBLIC FormatCore Cache)
110+
111+
ADD_BE_LIB(Formats
106112
parquet/arrow_memory_pool.cpp
107113
parquet/column_chunk_reader.cpp
108114
parquet/column_materializer.cpp
@@ -136,6 +142,7 @@ ADD_BE_LIB(Formats
136142
parquet/parquet_pos_reader.cpp
137143
)
138144

139-
target_link_libraries(Formats PUBLIC FormatAvro FormatJson FormatCsv FormatCore Cache)
145+
target_link_libraries(Formats PUBLIC FormatOrc FormatAvro FormatJson FormatCsv FormatCore Cache)
140146

141147
add_subdirectory(orc/apache-orc)
148+
target_link_libraries(FormatOrc PUBLIC orc)

be/src/connector/deletion_vector/deletion_bitmap.cpp renamed to be/src/formats/deletion_bitmap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "deletion_bitmap.h"
15+
#include "formats/deletion_bitmap.h"
1616

1717
#include "base/utility/defer_op.h"
1818
#include "column/vectorized_fwd.h"
@@ -64,4 +64,4 @@ void DeletionBitmap::add_value(uint64_t val) {
6464
roaring64_bitmap_add(_bitmap, val);
6565
}
6666

67-
} // namespace starrocks
67+
} // namespace starrocks

be/src/connector/deletion_vector/deletion_bitmap.h renamed to be/src/formats/deletion_bitmap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <roaring/roaring64.h>
1818

1919
#include <memory>
20+
#include <vector>
2021

2122
#include "column/vectorized_fwd.h"
2223
#include "common/statusor.h"
@@ -47,4 +48,4 @@ class DeletionBitmap {
4748

4849
using DeletionBitmapPtr = std::shared_ptr<DeletionBitmap>;
4950

50-
} // namespace starrocks
51+
} // namespace starrocks

0 commit comments

Comments
 (0)