From 8aecb8144402f788c6cc6ce7522db35a8168225d Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Thu, 23 Dec 2021 14:30:37 +0800 Subject: [PATCH 1/2] fix format Signed-off-by: Yuan Zhou --- cpp/src/arrow/adapters/orc/adapter.cc | 9 +- cpp/src/arrow/adapters/orc/adapter.h | 5 +- cpp/src/arrow/adapters/tensorflow/convert.h | 3 +- cpp/src/arrow/array/array_binary_test.cc | 6 +- cpp/src/arrow/array/array_dict_test.cc | 4 +- cpp/src/arrow/array/array_list_test.cc | 6 +- cpp/src/arrow/array/array_test.cc | 6 +- cpp/src/arrow/array/array_union_test.cc | 4 +- cpp/src/arrow/array/array_view_test.cc | 4 +- cpp/src/arrow/array/concatenate_test.cc | 7 +- cpp/src/arrow/array/dict_internal.h | 3 +- cpp/src/arrow/array/diff_test.cc | 7 +- cpp/src/arrow/buffer_test.cc | 7 +- cpp/src/arrow/builder_benchmark.cc | 3 +- cpp/src/arrow/c/bridge_benchmark.cc | 3 +- cpp/src/arrow/c/bridge_test.cc | 9 +- cpp/src/arrow/chunked_array_test.cc | 7 +- cpp/src/arrow/compare_benchmark.cc | 3 +- cpp/src/arrow/compute/exec_test.cc | 12 +- cpp/src/arrow/compute/function_benchmark.cc | 3 +- cpp/src/arrow/compute/function_test.cc | 7 +- cpp/src/arrow/compute/kernel_test.cc | 7 +- .../compute/kernels/aggregate_benchmark.cc | 3 +- .../arrow/compute/kernels/aggregate_test.cc | 11 +- .../arrow/compute/kernels/hash_aggregate.cc | 3 +- .../compute/kernels/hash_aggregate_test.cc | 4 +- .../kernels/scalar_arithmetic_benchmark.cc | 3 +- .../compute/kernels/scalar_arithmetic_test.cc | 11 +- .../kernels/scalar_boolean_benchmark.cc | 3 +- .../compute/kernels/scalar_boolean_test.cc | 4 +- .../compute/kernels/scalar_cast_benchmark.cc | 3 +- .../compute/kernels/scalar_cast_internal.cc | 1 + .../arrow/compute/kernels/scalar_cast_test.cc | 23 +- .../kernels/scalar_compare_benchmark.cc | 3 +- .../compute/kernels/scalar_compare_test.cc | 4 +- .../compute/kernels/scalar_fill_null_test.cc | 4 +- .../kernels/scalar_set_lookup_benchmark.cc | 3 +- .../compute/kernels/scalar_set_lookup_test.cc | 4 +- .../arrow/compute/kernels/scalar_string.cc | 1 - .../kernels/scalar_string_benchmark.cc | 3 +- .../compute/kernels/scalar_string_test.cc | 4 +- .../arrow/compute/kernels/scalar_validity.cc | 1 - cpp/src/arrow/compute/kernels/test_util.h | 7 +- .../compute/kernels/vector_hash_benchmark.cc | 6 +- .../arrow/compute/kernels/vector_hash_test.cc | 12 +- .../kernels/vector_partition_benchmark.cc | 3 +- .../kernels/vector_selection_benchmark.cc | 3 +- .../compute/kernels/vector_sort_benchmark.cc | 3 +- cpp/src/arrow/compute/registry_test.cc | 7 +- cpp/src/arrow/csv/chunker_test.cc | 7 +- cpp/src/arrow/csv/column_builder.cc | 3 +- cpp/src/arrow/csv/column_decoder.cc | 3 +- cpp/src/arrow/csv/column_decoder_test.cc | 7 +- cpp/src/arrow/csv/converter_benchmark.cc | 3 +- cpp/src/arrow/csv/parser_benchmark.cc | 3 +- cpp/src/arrow/csv/parser_test.cc | 7 +- cpp/src/arrow/csv/reader_test.cc | 7 +- cpp/src/arrow/csv/test_common.cc | 1 + cpp/src/arrow/csv/writer.cc | 2 +- cpp/src/arrow/csv/writer_test.cc | 4 +- cpp/src/arrow/dataset/discovery.cc | 10 +- cpp/src/arrow/dataset/expression_benchmark.cc | 3 +- cpp/src/arrow/dataset/expression_internal.h | 3 +- cpp/src/arrow/dataset/expression_test.cc | 11 +- cpp/src/arrow/dataset/file_base.cc | 10 +- cpp/src/arrow/dataset/file_base.h | 11 +- cpp/src/arrow/dataset/file_benchmark.cc | 3 +- cpp/src/arrow/dataset/file_orc.cc | 16 +- cpp/src/arrow/dataset/file_orc.h | 2 +- cpp/src/arrow/dataset/file_parquet.cc | 16 +- cpp/src/arrow/dataset/file_parquet_test.cc | 1 - cpp/src/arrow/dataset/file_test.cc | 6 +- cpp/src/arrow/dataset/scanner.cc | 15 +- cpp/src/arrow/dataset/scanner_internal.h | 3 +- cpp/src/arrow/dataset/scanner_test.cc | 4 +- cpp/src/arrow/dataset/test_util.h | 6 +- cpp/src/arrow/datum_test.cc | 7 +- cpp/src/arrow/dbi/hiveserver2/api.h | 1 - .../arrow/dbi/hiveserver2/columnar_row_set.cc | 1 - .../arrow/dbi/hiveserver2/hiveserver2_test.cc | 6 +- cpp/src/arrow/dbi/hiveserver2/operation.cc | 4 +- cpp/src/arrow/dbi/hiveserver2/operation.h | 1 - cpp/src/arrow/dbi/hiveserver2/service.cc | 7 +- cpp/src/arrow/dbi/hiveserver2/session.cc | 1 - cpp/src/arrow/dbi/hiveserver2/session.h | 1 - .../arrow/dbi/hiveserver2/thrift_internal.cc | 1 - .../arrow/dbi/hiveserver2/thrift_internal.h | 5 +- cpp/src/arrow/dbi/hiveserver2/types.cc | 1 - cpp/src/arrow/dbi/hiveserver2/util.cc | 6 +- cpp/src/arrow/extension_type_test.cc | 7 +- cpp/src/arrow/filesystem/api.h | 3 +- cpp/src/arrow/filesystem/filesystem.cc | 4 +- cpp/src/arrow/filesystem/filesystem_test.cc | 7 +- cpp/src/arrow/filesystem/hdfs.cc | 3 +- cpp/src/arrow/filesystem/hdfs_test.cc | 7 +- cpp/src/arrow/filesystem/localfs_test.cc | 7 +- cpp/src/arrow/filesystem/mockfs.cc | 3 +- cpp/src/arrow/filesystem/path_util.cc | 3 +- cpp/src/arrow/filesystem/s3_internal.h | 10 +- cpp/src/arrow/filesystem/s3_test_util.h | 5 +- cpp/src/arrow/filesystem/s3fs_benchmark.cc | 12 +- .../arrow/filesystem/s3fs_narrative_test.cc | 4 +- cpp/src/arrow/filesystem/s3fs_test.cc | 4 +- cpp/src/arrow/filesystem/test_util.cc | 9 +- cpp/src/arrow/filesystem/util_internal.cc | 1 + cpp/src/arrow/flight/client.cc | 21 +- cpp/src/arrow/flight/client.h | 5 +- .../arrow/flight/client_cookie_middleware.cc | 1 + .../arrow/flight/client_header_internal.cc | 1 + cpp/src/arrow/flight/flight_benchmark.cc | 11 +- cpp/src/arrow/flight/middleware_internal.h | 6 +- cpp/src/arrow/flight/perf_server.cc | 13 +- cpp/src/arrow/flight/protocol_internal.h | 5 +- .../arrow/flight/serialization_internal.cc | 1 - cpp/src/arrow/flight/server.cc | 19 +- cpp/src/arrow/flight/test_integration.cc | 11 +- cpp/src/arrow/flight/test_integration.h | 3 +- .../arrow/flight/test_integration_client.cc | 11 +- .../arrow/flight/test_integration_server.cc | 15 +- cpp/src/arrow/flight/test_server.cc | 4 +- cpp/src/arrow/flight/test_util.cc | 14 +- cpp/src/arrow/flight/test_util.h | 5 +- cpp/src/arrow/gpu/cuda_arrow_ipc.cc | 6 +- cpp/src/arrow/gpu/cuda_arrow_ipc.h | 3 +- cpp/src/arrow/gpu/cuda_benchmark.cc | 6 +- cpp/src/arrow/gpu/cuda_context.cc | 4 +- cpp/src/arrow/gpu/cuda_internal.h | 4 +- cpp/src/arrow/gpu/cuda_memory.cc | 9 +- cpp/src/arrow/gpu/cuda_test.cc | 12 +- cpp/src/arrow/io/buffered_test.cc | 4 +- cpp/src/arrow/io/caching.cc | 3 +- cpp/src/arrow/io/compressed_test.cc | 7 +- cpp/src/arrow/io/file.cc | 3 +- cpp/src/arrow/io/file_benchmark.cc | 15 +- cpp/src/arrow/io/file_test.cc | 4 +- cpp/src/arrow/io/hdfs.cc | 3 +- cpp/src/arrow/io/hdfs_internal.h | 4 +- cpp/src/arrow/io/hdfs_test.cc | 10 +- cpp/src/arrow/io/memory_benchmark.cc | 23 +- cpp/src/arrow/io/memory_test.cc | 7 +- cpp/src/arrow/io/mman.h | 4 +- cpp/src/arrow/ipc/feather.cc | 5 +- cpp/src/arrow/ipc/feather_test.cc | 7 +- cpp/src/arrow/ipc/file_to_stream.cc | 1 - cpp/src/arrow/ipc/json_simple.cc | 18 +- cpp/src/arrow/ipc/json_simple_test.cc | 7 +- cpp/src/arrow/ipc/message.cc | 1 - cpp/src/arrow/ipc/metadata_internal.cc | 5 +- cpp/src/arrow/ipc/metadata_internal.h | 5 +- cpp/src/arrow/ipc/options.cc | 3 +- cpp/src/arrow/ipc/read_write_benchmark.cc | 3 +- cpp/src/arrow/ipc/read_write_test.cc | 7 +- cpp/src/arrow/ipc/reader.cc | 23 +- cpp/src/arrow/ipc/stream_to_file.cc | 1 - cpp/src/arrow/ipc/tensor_test.cc | 7 +- cpp/src/arrow/ipc/test_common.cc | 3 +- cpp/src/arrow/ipc/writer.cc | 19 +- cpp/src/arrow/jniutil/jni_util.cc | 11 +- cpp/src/arrow/jniutil/jni_util.h | 4 +- cpp/src/arrow/jniutil/jni_util_test.cc | 3 +- cpp/src/arrow/json/chunked_builder_test.cc | 7 +- cpp/src/arrow/json/chunker.cc | 5 +- cpp/src/arrow/json/chunker_test.cc | 7 +- cpp/src/arrow/json/converter_test.cc | 4 +- cpp/src/arrow/json/object_parser.cc | 3 +- cpp/src/arrow/json/object_writer.cc | 3 +- cpp/src/arrow/json/parser.cc | 7 +- cpp/src/arrow/json/parser_benchmark.cc | 3 +- cpp/src/arrow/json/reader_test.cc | 7 +- cpp/src/arrow/json/test_common.h | 11 +- cpp/src/arrow/memory_pool_benchmark.cc | 1 - cpp/src/arrow/memory_pool_test.cc | 7 +- cpp/src/arrow/memory_pool_test.h | 4 +- cpp/src/arrow/python/arrow_to_pandas.cc | 24 +-- cpp/src/arrow/python/arrow_to_pandas.h | 3 +- cpp/src/arrow/python/benchmark.h | 1 - cpp/src/arrow/python/common.cc | 3 +- cpp/src/arrow/python/decimal.cc | 3 +- cpp/src/arrow/python/deserialize.cc | 16 +- cpp/src/arrow/python/extension_type.cc | 3 +- cpp/src/arrow/python/filesystem.cc | 1 + cpp/src/arrow/python/flight.cc | 4 +- cpp/src/arrow/python/helpers.cc | 3 +- cpp/src/arrow/python/helpers.h | 6 +- cpp/src/arrow/python/inference.cc | 9 +- cpp/src/arrow/python/inference.h | 6 +- cpp/src/arrow/python/init.cc | 1 + cpp/src/arrow/python/io.cc | 5 +- cpp/src/arrow/python/io.h | 1 - cpp/src/arrow/python/numpy_convert.cc | 10 +- cpp/src/arrow/python/numpy_convert.h | 3 +- cpp/src/arrow/python/numpy_internal.h | 10 +- cpp/src/arrow/python/numpy_interop.h | 4 +- cpp/src/arrow/python/numpy_to_arrow.cc | 22 +- cpp/src/arrow/python/numpy_to_arrow.h | 3 +- cpp/src/arrow/python/pyarrow.cc | 5 +- cpp/src/arrow/python/pyarrow.h | 4 +- cpp/src/arrow/python/python_test.cc | 15 +- cpp/src/arrow/python/python_to_arrow.cc | 17 +- cpp/src/arrow/python/python_to_arrow.h | 6 +- cpp/src/arrow/python/serialize.cc | 17 +- cpp/src/arrow/python/type_traits.h | 6 +- cpp/src/arrow/python/util/test_main.cc | 3 +- cpp/src/arrow/result_test.cc | 6 +- cpp/src/arrow/scalar_test.cc | 7 +- cpp/src/arrow/sparse_tensor.cc | 2 +- cpp/src/arrow/sparse_tensor_test.cc | 10 +- cpp/src/arrow/status_test.cc | 4 +- cpp/src/arrow/stl_iterator_test.cc | 7 +- cpp/src/arrow/stl_test.cc | 7 +- cpp/src/arrow/table_builder_test.cc | 7 +- cpp/src/arrow/table_test.cc | 9 +- cpp/src/arrow/tensor/converter.h | 4 +- cpp/src/arrow/tensor/coo_converter.cc | 3 +- cpp/src/arrow/tensor/csf_converter.cc | 3 +- cpp/src/arrow/tensor/csx_converter.cc | 3 +- .../tensor/tensor_conversion_benchmark.cc | 5 +- cpp/src/arrow/tensor_test.cc | 9 +- cpp/src/arrow/testing/generator.cc | 4 +- cpp/src/arrow/testing/gtest_common.h | 4 +- cpp/src/arrow/testing/gtest_util.cc | 1 + cpp/src/arrow/testing/gtest_util.h | 4 +- cpp/src/arrow/testing/json_integration.cc | 8 +- .../arrow/testing/json_integration_test.cc | 9 +- cpp/src/arrow/testing/json_internal.h | 13 +- cpp/src/arrow/testing/random_test.cc | 3 +- cpp/src/arrow/type_benchmark.cc | 3 +- cpp/src/arrow/type_test.cc | 7 +- cpp/src/arrow/util/align_util_test.cc | 8 +- cpp/src/arrow/util/async_generator_test.cc | 3 +- cpp/src/arrow/util/basic_decimal.cc | 8 +- cpp/src/arrow/util/benchmark_util.h | 3 +- .../arrow/util/bit_block_counter_benchmark.cc | 3 +- cpp/src/arrow/util/bit_block_counter_test.cc | 7 +- cpp/src/arrow/util/bit_stream_utils.h | 1 + cpp/src/arrow/util/bit_util_benchmark.cc | 3 +- cpp/src/arrow/util/bit_util_test.cc | 6 +- cpp/src/arrow/util/bpacking.cc | 1 + cpp/src/arrow/util/bpacking.h | 4 +- cpp/src/arrow/util/bpacking_avx2.cc | 1 + cpp/src/arrow/util/bpacking_avx512.cc | 1 + cpp/src/arrow/util/bpacking_neon.cc | 1 + cpp/src/arrow/util/byte_stream_split.h | 7 +- cpp/src/arrow/util/cache_benchmark.cc | 3 +- cpp/src/arrow/util/cache_test.cc | 4 +- cpp/src/arrow/util/cancel_test.cc | 7 +- cpp/src/arrow/util/checked_cast_test.cc | 6 +- cpp/src/arrow/util/compression.cc | 3 +- cpp/src/arrow/util/compression_benchmark.cc | 3 +- cpp/src/arrow/util/compression_brotli.cc | 9 +- cpp/src/arrow/util/compression_bz2.cc | 7 +- cpp/src/arrow/util/compression_fastpfor.cc | 8 +- cpp/src/arrow/util/compression_internal.h | 2 +- cpp/src/arrow/util/compression_lz4.cc | 7 +- cpp/src/arrow/util/compression_snappy.cc | 5 +- cpp/src/arrow/util/compression_test.cc | 8 +- cpp/src/arrow/util/compression_zlib.cc | 21 +- cpp/src/arrow/util/compression_zstd.cc | 5 +- cpp/src/arrow/util/cpu_info.cc | 1 + cpp/src/arrow/util/decimal.cc | 3 +- cpp/src/arrow/util/decimal_benchmark.cc | 3 +- cpp/src/arrow/util/decimal_test.cc | 9 +- cpp/src/arrow/util/delimiting.cc | 1 + cpp/src/arrow/util/formatting.cc | 1 + cpp/src/arrow/util/formatting_util_test.cc | 4 +- cpp/src/arrow/util/future_test.cc | 8 +- cpp/src/arrow/util/hashing_benchmark.cc | 3 +- cpp/src/arrow/util/hashing_test.cc | 9 +- cpp/src/arrow/util/int_util_benchmark.cc | 3 +- cpp/src/arrow/util/int_util_test.cc | 7 +- cpp/src/arrow/util/io_util.cc | 12 +- cpp/src/arrow/util/io_util_test.cc | 4 +- cpp/src/arrow/util/iterator_test.cc | 3 +- cpp/src/arrow/util/key_value_metadata.cc | 3 +- cpp/src/arrow/util/key_value_metadata_test.cc | 7 +- cpp/src/arrow/util/logging.cc | 1 + cpp/src/arrow/util/logging_test.cc | 8 +- cpp/src/arrow/util/memory.cc | 3 +- cpp/src/arrow/util/queue_benchmark.cc | 4 +- cpp/src/arrow/util/queue_test.cc | 3 +- cpp/src/arrow/util/range_benchmark.cc | 4 +- cpp/src/arrow/util/range_test.cc | 7 +- cpp/src/arrow/util/rle_encoding_test.cc | 7 +- cpp/src/arrow/util/stl_util_test.cc | 6 +- cpp/src/arrow/util/string_test.cc | 7 +- cpp/src/arrow/util/task_group_test.cc | 7 +- cpp/src/arrow/util/tdigest_benchmark.cc | 3 +- cpp/src/arrow/util/tdigest_test.cc | 7 +- cpp/src/arrow/util/thread_pool_benchmark.cc | 3 +- cpp/src/arrow/util/thread_pool_test.cc | 4 +- cpp/src/arrow/util/time.cc | 3 +- cpp/src/arrow/util/time_test.cc | 3 +- cpp/src/arrow/util/trie_benchmark.cc | 3 +- cpp/src/arrow/util/trie_test.cc | 7 +- cpp/src/arrow/util/uri_test.cc | 7 +- cpp/src/arrow/util/utf8.cc | 3 +- cpp/src/arrow/util/utf8_util_benchmark.cc | 3 +- cpp/src/arrow/util/utf8_util_test.cc | 4 +- cpp/src/arrow/util/value_parsing_benchmark.cc | 3 +- cpp/src/arrow/util/value_parsing_test.cc | 7 +- cpp/src/arrow/util/variant_benchmark.cc | 3 +- cpp/src/arrow/util/variant_test.cc | 6 +- cpp/src/gandiva/annotator_test.cc | 5 +- cpp/src/gandiva/bitmap_accumulator_test.cc | 5 +- cpp/src/gandiva/cache.cc | 1 + cpp/src/gandiva/cast_time.cc | 4 +- cpp/src/gandiva/compiled_expr.h | 1 + cpp/src/gandiva/context_helper.cc | 3 +- cpp/src/gandiva/date_utils.cc | 4 +- cpp/src/gandiva/date_utils.h | 1 - cpp/src/gandiva/decimal_ir.cc | 3 +- cpp/src/gandiva/decimal_scalar.h | 1 + cpp/src/gandiva/decimal_type_util.cc | 1 + cpp/src/gandiva/decimal_type_util_test.cc | 3 +- cpp/src/gandiva/engine.h | 3 +- cpp/src/gandiva/engine_llvm_test.cc | 5 +- cpp/src/gandiva/eval_batch.h | 1 - cpp/src/gandiva/execution_context.h | 1 + cpp/src/gandiva/exported_funcs.h | 1 + cpp/src/gandiva/exported_funcs_registry.h | 4 +- cpp/src/gandiva/expr_validator.cc | 4 +- cpp/src/gandiva/expr_validator.h | 1 - cpp/src/gandiva/expression.cc | 1 + cpp/src/gandiva/expression_registry.cc | 4 +- cpp/src/gandiva/expression_registry_test.cc | 3 +- cpp/src/gandiva/filter.cc | 1 - cpp/src/gandiva/filter.h | 1 - cpp/src/gandiva/function_holder_registry.h | 1 - cpp/src/gandiva/function_registry.cc | 9 +- cpp/src/gandiva/function_registry.h | 1 + .../gandiva/function_registry_arithmetic.cc | 1 + .../gandiva/function_registry_arithmetic.h | 1 + cpp/src/gandiva/function_registry_common.h | 9 +- cpp/src/gandiva/function_registry_datetime.cc | 29 +-- cpp/src/gandiva/function_registry_datetime.h | 1 + cpp/src/gandiva/function_registry_hash.cc | 1 + cpp/src/gandiva/function_registry_hash.h | 1 + cpp/src/gandiva/function_registry_math_ops.cc | 1 + cpp/src/gandiva/function_registry_math_ops.h | 1 + cpp/src/gandiva/function_registry_string.cc | 21 +- cpp/src/gandiva/function_registry_string.h | 1 + cpp/src/gandiva/function_registry_test.cc | 1 + .../function_registry_timestamp_arithmetic.cc | 1 + .../function_registry_timestamp_arithmetic.h | 1 + cpp/src/gandiva/function_signature.cc | 9 +- cpp/src/gandiva/function_signature_test.cc | 4 +- cpp/src/gandiva/gdv_function_stubs.cc | 137 ++++++------ cpp/src/gandiva/gdv_function_stubs.h | 21 +- cpp/src/gandiva/hash_utils.cc | 2 + cpp/src/gandiva/hash_utils.h | 1 + cpp/src/gandiva/hash_utils_test.cc | 4 +- .../gandiva/jni/expression_registry_helper.cc | 3 +- cpp/src/gandiva/jni/jni_common.cc | 7 +- cpp/src/gandiva/json_holder.cc | 6 +- cpp/src/gandiva/json_holder.h | 7 +- cpp/src/gandiva/json_holder_test.cc | 16 +- cpp/src/gandiva/like_holder.cc | 1 + cpp/src/gandiva/like_holder.h | 5 +- cpp/src/gandiva/like_holder_test.cc | 5 +- cpp/src/gandiva/literal_holder.cc | 4 +- cpp/src/gandiva/literal_holder.h | 6 +- cpp/src/gandiva/llvm_generator.h | 1 - cpp/src/gandiva/llvm_generator_test.cc | 5 +- cpp/src/gandiva/local_bitmaps_holder.h | 3 +- cpp/src/gandiva/lru_cache_test.cc | 4 +- cpp/src/gandiva/lvalue.h | 3 +- cpp/src/gandiva/node.h | 1 - cpp/src/gandiva/node_visitor.h | 1 - cpp/src/gandiva/precompiled/arithmetic_ops.cc | 64 +++--- .../precompiled/arithmetic_ops_test.cc | 1 + cpp/src/gandiva/precompiled/bitmap_test.cc | 1 + cpp/src/gandiva/precompiled/decimal_ops.h | 1 + .../gandiva/precompiled/decimal_ops_test.cc | 4 +- .../precompiled/epoch_time_point_test.cc | 9 +- .../gandiva/precompiled/extended_math_ops.cc | 1 + .../precompiled/extended_math_ops_test.cc | 2 + cpp/src/gandiva/precompiled/hash_test.cc | 2 +- cpp/src/gandiva/precompiled/testing.h | 5 +- cpp/src/gandiva/precompiled/time.cc | 56 ++--- cpp/src/gandiva/precompiled/time_test.cc | 4 +- .../precompiled/timestamp_arithmetic.cc | 9 +- cpp/src/gandiva/precompiled/types.h | 5 +- cpp/src/gandiva/projector.cc | 1 - cpp/src/gandiva/projector.h | 1 - cpp/src/gandiva/random_generator_holder.cc | 1 + cpp/src/gandiva/random_generator_holder.h | 1 - .../gandiva/random_generator_holder_test.cc | 4 +- cpp/src/gandiva/selection_vector.cc | 1 - cpp/src/gandiva/selection_vector.h | 1 - cpp/src/gandiva/selection_vector_impl.h | 3 +- cpp/src/gandiva/selection_vector_test.cc | 4 +- cpp/src/gandiva/tests/binary_test.cc | 2 +- cpp/src/gandiva/tests/boolean_expr_test.cc | 2 +- cpp/src/gandiva/tests/date_time_test.cc | 83 ++++---- cpp/src/gandiva/tests/decimal_single_test.cc | 4 +- cpp/src/gandiva/tests/decimal_test.cc | 7 +- cpp/src/gandiva/tests/filter_project_test.cc | 1 + cpp/src/gandiva/tests/filter_test.cc | 2 + cpp/src/gandiva/tests/generate_data.h | 1 + cpp/src/gandiva/tests/hash_test.cc | 8 +- cpp/src/gandiva/tests/huge_table_test.cc | 1 + cpp/src/gandiva/tests/if_expr_test.cc | 2 +- cpp/src/gandiva/tests/literal_test.cc | 2 +- cpp/src/gandiva/tests/micro_benchmarks.cc | 1 + cpp/src/gandiva/tests/null_validity_test.cc | 1 + .../tests/projector_build_validation_test.cc | 1 + cpp/src/gandiva/tests/projector_test.cc | 201 +++++++++--------- cpp/src/gandiva/tests/timed_evaluate.h | 1 + cpp/src/gandiva/tests/to_string_test.cc | 1 + cpp/src/gandiva/tests/utf8_test.cc | 2 +- cpp/src/gandiva/to_date_holder.h | 1 - cpp/src/gandiva/to_date_holder_test.cc | 8 +- cpp/src/gandiva/tree_expr_test.cc | 4 +- cpp/src/jni/dataset/jni_wrapper.cc | 55 ++--- cpp/src/jni/orc/jni_wrapper.cpp | 11 +- .../parquet/arrow/arrow_reader_writer_test.cc | 5 +- cpp/src/parquet/arrow/arrow_schema_test.cc | 10 +- cpp/src/parquet/arrow/path_internal.h | 1 - cpp/src/parquet/arrow/path_internal_test.cc | 7 +- .../parquet/arrow/reader_writer_benchmark.cc | 18 +- .../arrow/reconstruct_internal_test.cc | 15 +- cpp/src/parquet/arrow/schema.cc | 1 - cpp/src/parquet/arrow/schema.h | 1 - cpp/src/parquet/arrow/writer.cc | 1 - cpp/src/parquet/bloom_filter.cc | 3 +- cpp/src/parquet/bloom_filter_test.cc | 4 +- cpp/src/parquet/column_io_benchmark.cc | 4 +- cpp/src/parquet/column_reader_test.cc | 3 +- cpp/src/parquet/column_scanner_test.cc | 4 +- cpp/src/parquet/column_writer_test.cc | 8 +- cpp/src/parquet/encoding.cc | 1 - cpp/src/parquet/encoding.h | 1 - cpp/src/parquet/encoding_benchmark.cc | 8 +- cpp/src/parquet/encoding_test.cc | 5 +- cpp/src/parquet/encryption/crypto_factory.cc | 4 +- .../parquet/encryption/encryption_internal.cc | 1 + .../parquet/encryption/file_key_unwrapper.cc | 4 +- .../parquet/encryption/file_key_unwrapper.h | 1 - .../parquet/encryption/file_key_wrapper.cc | 1 + cpp/src/parquet/encryption/file_key_wrapper.h | 1 - .../encryption/internal_file_decryptor.cc | 1 + .../encryption/internal_file_encryptor.cc | 1 + .../parquet/encryption/key_management_test.cc | 1 - cpp/src/parquet/encryption/key_material.cc | 4 +- cpp/src/parquet/encryption/key_metadata.cc | 4 +- cpp/src/parquet/encryption/key_metadata.h | 1 - .../parquet/encryption/key_metadata_test.cc | 5 +- .../encryption/key_toolkit_internal.cc | 4 +- cpp/src/parquet/encryption/kms_client.h | 1 - .../encryption/local_wrap_kms_client.cc | 4 +- .../encryption/local_wrap_kms_client.h | 1 - .../encryption/read_configurations_test.cc | 1 - .../encryption/test_encryption_util.cc | 5 +- .../parquet/encryption/test_encryption_util.h | 5 +- .../parquet/encryption/test_in_memory_kms.cc | 4 +- .../parquet/encryption/test_in_memory_kms.h | 1 - .../two_level_cache_with_expiration_test.cc | 8 +- .../encryption/write_configurations_test.cc | 4 +- cpp/src/parquet/file_deserialize_test.cc | 9 +- cpp/src/parquet/file_serialize_test.cc | 1 - cpp/src/parquet/hasher.h | 1 + cpp/src/parquet/level_conversion.cc | 1 - cpp/src/parquet/level_conversion_inc.h | 3 +- cpp/src/parquet/level_conversion_test.cc | 5 +- cpp/src/parquet/platform.cc | 1 - cpp/src/parquet/printer.cc | 1 - cpp/src/parquet/properties.cc | 4 +- cpp/src/parquet/properties_test.cc | 4 +- cpp/src/parquet/reader_test.cc | 2 +- cpp/src/parquet/schema_test.cc | 3 +- cpp/src/parquet/statistics_test.cc | 4 +- cpp/src/parquet/test_util.h | 5 +- cpp/src/parquet/thrift_internal.h | 12 +- cpp/src/parquet/types.cc | 7 +- cpp/src/parquet/types.h | 1 - cpp/src/parquet/types_test.cc | 3 +- cpp/src/plasma/client.cc | 1 - cpp/src/plasma/common.cc | 1 - cpp/src/plasma/common.h | 3 +- cpp/src/plasma/dlmalloc.cc | 3 +- cpp/src/plasma/events.cc | 4 +- cpp/src/plasma/eviction_policy.cc | 3 +- cpp/src/plasma/external_store.cc | 4 +- cpp/src/plasma/hash_table_store.cc | 4 +- cpp/src/plasma/io.cc | 1 - ...org_apache_arrow_plasma_PlasmaClientJNI.cc | 1 - cpp/src/plasma/plasma.h | 3 +- cpp/src/plasma/plasma_allocator.cc | 3 +- cpp/src/plasma/quota_aware_policy.cc | 5 +- cpp/src/plasma/store.cc | 4 +- cpp/src/plasma/test/client_tests.cc | 4 +- cpp/src/plasma/test/external_store_tests.cc | 4 +- cpp/src/plasma/test/serialization_tests.cc | 6 +- 493 files changed, 1483 insertions(+), 1544 deletions(-) diff --git a/cpp/src/arrow/adapters/orc/adapter.cc b/cpp/src/arrow/adapters/orc/adapter.cc index 030892ee92b41..9533618198317 100644 --- a/cpp/src/arrow/adapters/orc/adapter.cc +++ b/cpp/src/arrow/adapters/orc/adapter.cc @@ -438,8 +438,9 @@ class ORCFileReader::Impl { return Status::OK(); } - Status NextBatchReader(int64_t batch_size, const std::vector& include_names, - std::shared_ptr* out) { + Status NextBatchReader(int64_t batch_size, + const std::vector& include_names, + std::shared_ptr* out) { liborc::RowReaderOptions opts; if (!include_names.empty()) { RETURN_NOT_OK(SelectNames(&opts, include_names)); @@ -559,8 +560,8 @@ Status ORCFileReader::NextStripeReader(int64_t batch_size, } Status ORCFileReader::NextBatchReader(int64_t batch_size, - const std::vector& include_names, - std::shared_ptr* out) { + const std::vector& include_names, + std::shared_ptr* out) { return impl_->NextBatchReader(batch_size, include_names, out); } diff --git a/cpp/src/arrow/adapters/orc/adapter.h b/cpp/src/arrow/adapters/orc/adapter.h index 8498e8f22aaee..a086ec74eec6e 100644 --- a/cpp/src/arrow/adapters/orc/adapter.h +++ b/cpp/src/arrow/adapters/orc/adapter.h @@ -174,8 +174,9 @@ class ARROW_EXPORT ORCFileReader { /// /// \param[in] include_indices the selected field names to read /// \param[out] out the returned stripe reader - Status NextBatchReader(int64_t batch_size, const std::vector& include_names, - std::shared_ptr* out); + Status NextBatchReader(int64_t batch_size, + const std::vector& include_names, + std::shared_ptr* out); /// \brief The number of stripes in the file int64_t NumberOfStripes(); diff --git a/cpp/src/arrow/adapters/tensorflow/convert.h b/cpp/src/arrow/adapters/tensorflow/convert.h index 9d093eddf6b59..d27eaa83a764e 100644 --- a/cpp/src/arrow/adapters/tensorflow/convert.h +++ b/cpp/src/arrow/adapters/tensorflow/convert.h @@ -19,9 +19,8 @@ #include -#include "tensorflow/core/framework/op.h" - #include "arrow/type.h" +#include "tensorflow/core/framework/op.h" // These utilities are supposed to be included in TensorFlow operators // that need to be compiled separately from Arrow because of ABI issues. diff --git a/cpp/src/arrow/array/array_binary_test.cc b/cpp/src/arrow/array/array_binary_test.cc index 5c247a6dc66f7..930618c723bdc 100644 --- a/cpp/src/arrow/array/array_binary_test.cc +++ b/cpp/src/arrow/array/array_binary_test.cc @@ -15,15 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_binary.h" #include "arrow/buffer.h" diff --git a/cpp/src/arrow/array/array_dict_test.cc b/cpp/src/arrow/array/array_dict_test.cc index d6f7f3c86f5d8..240c1ab87570d 100644 --- a/cpp/src/arrow/array/array_dict_test.cc +++ b/cpp/src/arrow/array/array_dict_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -22,8 +24,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/array/builder_decimal.h" #include "arrow/array/builder_dict.h" diff --git a/cpp/src/arrow/array/array_list_test.cc b/cpp/src/arrow/array/array_list_test.cc index a50cbcc13cf0f..96e70bd1e3fbf 100644 --- a/cpp/src/arrow/array/array_list_test.cc +++ b/cpp/src/arrow/array/array_list_test.cc @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_nested.h" #include "arrow/buffer.h" diff --git a/cpp/src/arrow/array/array_test.cc b/cpp/src/arrow/array/array_test.cc index a97bf134604e7..f98df3028f656 100644 --- a/cpp/src/arrow/array/array_test.cc +++ b/cpp/src/arrow/array/array_test.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include @@ -27,9 +30,6 @@ #include #include -#include -#include - #include "arrow/array/array_base.h" #include "arrow/array/array_binary.h" #include "arrow/array/array_decimal.h" diff --git a/cpp/src/arrow/array/array_union_test.cc b/cpp/src/arrow/array/array_union_test.cc index 88d25e823bbfd..e0a53fd00ce6d 100644 --- a/cpp/src/arrow/array/array_union_test.cc +++ b/cpp/src/arrow/array/array_union_test.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include - #include +#include + #include "arrow/array.h" #include "arrow/array/builder_nested.h" #include "arrow/array/builder_union.h" diff --git a/cpp/src/arrow/array/array_view_test.cc b/cpp/src/arrow/array/array_view_test.cc index 07dc3014e4029..fc7d0e44cc64a 100644 --- a/cpp/src/arrow/array/array_view_test.cc +++ b/cpp/src/arrow/array/array_view_test.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include -#include - #include "arrow/array/array_base.h" #include "arrow/array/array_dict.h" #include "arrow/array/array_nested.h" diff --git a/cpp/src/arrow/array/concatenate_test.cc b/cpp/src/arrow/array/concatenate_test.cc index c6e6e5bcc5762..7d0cc693cc28b 100644 --- a/cpp/src/arrow/array/concatenate_test.cc +++ b/cpp/src/arrow/array/concatenate_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/array/concatenate.h" + +#include + #include #include #include @@ -28,11 +32,8 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/array/builder_binary.h" -#include "arrow/array/concatenate.h" #include "arrow/buffer.h" #include "arrow/status.h" #include "arrow/testing/gtest_common.h" diff --git a/cpp/src/arrow/array/dict_internal.h b/cpp/src/arrow/array/dict_internal.h index aa027ac22dea3..3ef47da10d33c 100644 --- a/cpp/src/arrow/array/dict_internal.h +++ b/cpp/src/arrow/array/dict_internal.h @@ -17,8 +17,6 @@ #pragma once -#include "arrow/array/builder_dict.h" - #include #include #include @@ -27,6 +25,7 @@ #include #include "arrow/array.h" +#include "arrow/array/builder_dict.h" #include "arrow/buffer.h" #include "arrow/status.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/array/diff_test.cc b/cpp/src/arrow/array/diff_test.cc index a5022be59d749..6e3c7e70549ee 100644 --- a/cpp/src/arrow/array/diff_test.cc +++ b/cpp/src/arrow/array/diff_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/array/diff.h" + +#include + #include #include #include @@ -25,10 +29,7 @@ #include #include -#include - #include "arrow/array.h" -#include "arrow/array/diff.h" #include "arrow/compute/api.h" #include "arrow/status.h" #include "arrow/testing/gtest_common.h" diff --git a/cpp/src/arrow/buffer_test.cc b/cpp/src/arrow/buffer_test.cc index 02b96c3b4937e..a32527a0969de 100644 --- a/cpp/src/arrow/buffer_test.cc +++ b/cpp/src/arrow/buffer_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/buffer.h" + +#include + #include #include #include @@ -24,9 +28,6 @@ #include #include -#include - -#include "arrow/buffer.h" #include "arrow/buffer_builder.h" #include "arrow/device.h" #include "arrow/io/interfaces.h" diff --git a/cpp/src/arrow/builder_benchmark.cc b/cpp/src/arrow/builder_benchmark.cc index d0edb4b2d08ed..37671e7a14ac2 100644 --- a/cpp/src/arrow/builder_benchmark.cc +++ b/cpp/src/arrow/builder_benchmark.cc @@ -23,14 +23,13 @@ #include #include -#include "benchmark/benchmark.h" - #include "arrow/builder.h" #include "arrow/memory_pool.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/bit_util.h" #include "arrow/util/decimal.h" #include "arrow/util/string_view.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/c/bridge_benchmark.cc b/cpp/src/arrow/c/bridge_benchmark.cc index 1ae4657fc9c0c..6d967a9c0d0d8 100644 --- a/cpp/src/arrow/c/bridge_benchmark.cc +++ b/cpp/src/arrow/c/bridge_benchmark.cc @@ -17,8 +17,6 @@ #include -#include "benchmark/benchmark.h" - #include "arrow/array.h" #include "arrow/c/bridge.h" #include "arrow/c/helpers.h" @@ -27,6 +25,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/util/key_value_metadata.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/c/bridge_test.cc b/cpp/src/arrow/c/bridge_test.cc index 317fd01f17c62..79ffbd019b434 100644 --- a/cpp/src/arrow/c/bridge_test.cc +++ b/cpp/src/arrow/c/bridge_test.cc @@ -15,6 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/c/bridge.h" + +#include +#include + #include #include #include @@ -23,10 +28,6 @@ #include #include -#include -#include - -#include "arrow/c/bridge.h" #include "arrow/c/helpers.h" #include "arrow/c/util_internal.h" #include "arrow/ipc/json_simple.h" diff --git a/cpp/src/arrow/chunked_array_test.cc b/cpp/src/arrow/chunked_array_test.cc index c5907549fe4ef..fe2ae8efd3053 100644 --- a/cpp/src/arrow/chunked_array_test.cc +++ b/cpp/src/arrow/chunked_array_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/chunked_array.h" + +#include + #include #include #include -#include - -#include "arrow/chunked_array.h" #include "arrow/status.h" #include "arrow/testing/gtest_common.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/compare_benchmark.cc b/cpp/src/arrow/compare_benchmark.cc index 2699f90f69e1c..fe15a5958501f 100644 --- a/cpp/src/arrow/compare_benchmark.cc +++ b/cpp/src/arrow/compare_benchmark.cc @@ -19,8 +19,6 @@ #include #include -#include "benchmark/benchmark.h" - #include "arrow/array.h" #include "arrow/compare.h" #include "arrow/testing/gtest_util.h" @@ -28,6 +26,7 @@ #include "arrow/util/benchmark_util.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/compute/exec_test.cc b/cpp/src/arrow/compute/exec_test.cc index e9bd57596b5f4..50c5668eb0660 100644 --- a/cpp/src/arrow/compute/exec_test.cc +++ b/cpp/src/arrow/compute/exec_test.cc @@ -15,20 +15,18 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "arrow/compute/exec.h" #include -#include "arrow/testing/gtest_util.h" -#include "arrow/testing/random.h" +#include +#include +#include #include "arrow/array/array_base.h" #include "arrow/array/data.h" #include "arrow/buffer.h" #include "arrow/chunked_array.h" -#include "arrow/compute/exec.h" #include "arrow/compute/exec_internal.h" #include "arrow/compute/function.h" #include "arrow/compute/kernel.h" @@ -36,6 +34,8 @@ #include "arrow/memory_pool.h" #include "arrow/scalar.h" #include "arrow/status.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/testing/random.h" #include "arrow/type.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_ops.h" diff --git a/cpp/src/arrow/compute/function_benchmark.cc b/cpp/src/arrow/compute/function_benchmark.cc index 5dc305bdd8945..8702cf32c8f23 100644 --- a/cpp/src/arrow/compute/function_benchmark.cc +++ b/cpp/src/arrow/compute/function_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/array/array_base.h" #include "arrow/compute/api.h" #include "arrow/memory_pool.h" @@ -24,6 +22,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/compute/function_test.cc b/cpp/src/arrow/compute/function_test.cc index b6f1815b89e9e..46f0619e2d5d0 100644 --- a/cpp/src/arrow/compute/function_test.cc +++ b/cpp/src/arrow/compute/function_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/compute/function.h" + +#include + #include #include #include -#include - -#include "arrow/compute/function.h" #include "arrow/compute/kernel.h" #include "arrow/datum.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/compute/kernel_test.cc b/cpp/src/arrow/compute/kernel_test.cc index a5ef9d44e1878..fb5329a45aba0 100644 --- a/cpp/src/arrow/compute/kernel_test.cc +++ b/cpp/src/arrow/compute/kernel_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/compute/kernel.h" + +#include + #include #include #include -#include - -#include "arrow/compute/kernel.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/compute/kernels/aggregate_benchmark.cc b/cpp/src/arrow/compute/kernels/aggregate_benchmark.cc index 39cfeb039a84b..4bd736b101d7a 100644 --- a/cpp/src/arrow/compute/kernels/aggregate_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/aggregate_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/compute/api.h" @@ -25,6 +23,7 @@ #include "arrow/util/benchmark_util.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_reader.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/aggregate_test.cc b/cpp/src/arrow/compute/kernels/aggregate_test.cc index ad7e391495ec2..31e9d72aeb6af 100644 --- a/cpp/src/arrow/compute/kernels/aggregate_test.cc +++ b/cpp/src/arrow/compute/kernels/aggregate_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -22,8 +24,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/chunked_array.h" #include "arrow/compute/api_aggregate.h" @@ -33,15 +33,14 @@ #include "arrow/compute/kernels/aggregate_internal.h" #include "arrow/compute/kernels/test_util.h" #include "arrow/compute/registry.h" +#include "arrow/testing/gtest_common.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/testing/random.h" #include "arrow/type.h" #include "arrow/type_traits.h" #include "arrow/util/bitmap_reader.h" #include "arrow/util/checked_cast.h" #include "arrow/util/int_util_internal.h" - -#include "arrow/testing/gtest_common.h" -#include "arrow/testing/gtest_util.h" -#include "arrow/testing/random.h" #include "arrow/util/logging.h" namespace arrow { diff --git a/cpp/src/arrow/compute/kernels/hash_aggregate.cc b/cpp/src/arrow/compute/kernels/hash_aggregate.cc index dccbe50d9cf8c..b084302608c80 100644 --- a/cpp/src/arrow/compute/kernels/hash_aggregate.cc +++ b/cpp/src/arrow/compute/kernels/hash_aggregate.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/compute/api_aggregate.h" - #include #include #include @@ -24,6 +22,7 @@ #include #include "arrow/buffer_builder.h" +#include "arrow/compute/api_aggregate.h" #include "arrow/compute/api_vector.h" #include "arrow/compute/exec_internal.h" #include "arrow/compute/kernel.h" diff --git a/cpp/src/arrow/compute/kernels/hash_aggregate_test.cc b/cpp/src/arrow/compute/kernels/hash_aggregate_test.cc index 7858d8bb147d8..943c101f36894 100644 --- a/cpp/src/arrow/compute/kernels/hash_aggregate_test.cc +++ b/cpp/src/arrow/compute/kernels/hash_aggregate_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -22,8 +24,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/chunked_array.h" #include "arrow/compute/api_aggregate.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc index 01d9ec944ee44..869c8044b733f 100644 --- a/cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/compute/api_scalar.h" @@ -24,6 +22,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc b/cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc index cd5f298ae5188..20add9ed9afcd 100644 --- a/cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc @@ -15,29 +15,28 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include #include -#include - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/compute/api.h" #include "arrow/compute/kernels/codegen_internal.h" #include "arrow/compute/kernels/test_util.h" +#include "arrow/testing/gtest_common.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/testing/random.h" #include "arrow/type.h" #include "arrow/type_traits.h" #include "arrow/util/bit_util.h" #include "arrow/util/checked_cast.h" #include "arrow/util/string.h" -#include "arrow/testing/gtest_common.h" -#include "arrow/testing/gtest_util.h" -#include "arrow/testing/random.h" - namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_boolean_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_boolean_benchmark.cc index 969b91a141733..571bbe91baea8 100644 --- a/cpp/src/arrow/compute/kernels/scalar_boolean_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_boolean_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/compute/api_scalar.h" @@ -24,6 +22,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_boolean_test.cc b/cpp/src/arrow/compute/kernels/scalar_boolean_test.cc index 7d3f68e2aefb2..be2f250d2f02b 100644 --- a/cpp/src/arrow/compute/kernels/scalar_boolean_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_boolean_test.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include -#include - #include "arrow/chunked_array.h" #include "arrow/compute/api_scalar.h" #include "arrow/compute/kernels/test_util.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_cast_benchmark.cc index 8eea8725ddf61..f9bb333c0b9bd 100644 --- a/cpp/src/arrow/compute/kernels/scalar_cast_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_cast_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/compute/cast.h" @@ -24,6 +22,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc b/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc index 7221722d53a3b..e6186d5da7946 100644 --- a/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc +++ b/cpp/src/arrow/compute/kernels/scalar_cast_internal.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/compute/kernels/scalar_cast_internal.h" + #include "arrow/compute/cast_internal.h" #include "arrow/compute/kernels/common.h" #include "arrow/extension_type.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_test.cc b/cpp/src/arrow/compute/kernels/scalar_cast_test.cc index 1cf1439693b40..3607672e70ab1 100644 --- a/cpp/src/arrow/compute/kernels/scalar_cast_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_cast_test.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include @@ -22,13 +25,14 @@ #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_decimal.h" #include "arrow/buffer.h" #include "arrow/chunked_array.h" +#include "arrow/compute/api_vector.h" +#include "arrow/compute/cast.h" +#include "arrow/compute/kernel.h" +#include "arrow/compute/kernels/test_util.h" #include "arrow/extension_type.h" #include "arrow/status.h" #include "arrow/testing/extension_type.h" @@ -42,11 +46,6 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/decimal.h" -#include "arrow/compute/api_vector.h" -#include "arrow/compute/cast.h" -#include "arrow/compute/kernel.h" -#include "arrow/compute/kernels/test_util.h" - namespace arrow { using internal::checked_cast; @@ -1042,10 +1041,10 @@ TEST(Cast, TimestampToTimestamp) { CheckCast(will_be_truncated, coarse, options); } - for (auto types : { - TimestampTypePair{timestamp(TimeUnit::MILLI, "UTC+8"), timestamp(TimeUnit::MILLI)} - }) { - auto coarse = ArrayFromJSON(types.coarse, "[0, null, 200000000000, 1000000000, 2000000000]"); + for (auto types : {TimestampTypePair{timestamp(TimeUnit::MILLI, "UTC+8"), + timestamp(TimeUnit::MILLI)}}) { + auto coarse = + ArrayFromJSON(types.coarse, "[0, null, 200000000000, 1000000000, 2000000000]"); auto promoted = ArrayFromJSON(types.fine, "[0, null, 200000000000, 1000000000, 2000000000]"); diff --git a/cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc index ce18365fb5dc4..0efec079cfde9 100644 --- a/cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/compute/api_scalar.h" @@ -24,6 +22,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_compare_test.cc b/cpp/src/arrow/compute/kernels/scalar_compare_test.cc index 7b0906395d7d2..2394ab94137d5 100644 --- a/cpp/src/arrow/compute/kernels/scalar_compare_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_compare_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -22,8 +24,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/compute/api.h" #include "arrow/compute/kernels/test_util.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_fill_null_test.cc b/cpp/src/arrow/compute/kernels/scalar_fill_null_test.cc index de1e0802343e5..55367adff0fff 100644 --- a/cpp/src/arrow/compute/kernels/scalar_fill_null_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_fill_null_test.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include -#include - #include "arrow/array/array_base.h" #include "arrow/compute/api.h" #include "arrow/result.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc index 02f6af4bee317..1cffed5eee223 100644 --- a/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_set_lookup_benchmark.cc @@ -15,14 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/compute/api_scalar.h" #include "arrow/compute/kernels/common.h" #include "arrow/compute/kernels/test_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc b/cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc index 272502caa5797..1b5aa4ca4229b 100644 --- a/cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -26,8 +28,6 @@ #include #include -#include - #include "arrow/array/array_base.h" #include "arrow/array/builder_binary.h" #include "arrow/array/builder_primitive.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_string.cc b/cpp/src/arrow/compute/kernels/scalar_string.cc index d5473749fe177..efc55c550a5b8 100644 --- a/cpp/src/arrow/compute/kernels/scalar_string.cc +++ b/cpp/src/arrow/compute/kernels/scalar_string.cc @@ -31,7 +31,6 @@ #include "arrow/array/builder_binary.h" #include "arrow/array/builder_nested.h" #include "arrow/buffer_builder.h" - #include "arrow/builder.h" #include "arrow/compute/api_scalar.h" #include "arrow/compute/kernels/common.h" diff --git a/cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc b/cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc index 32ac5a7df3b97..becebf03cf199 100644 --- a/cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc @@ -15,13 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/compute/api_scalar.h" #include "arrow/compute/kernels/test_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/scalar_string_test.cc b/cpp/src/arrow/compute/kernels/scalar_string_test.cc index 577493913b511..1859dcceb5399 100644 --- a/cpp/src/arrow/compute/kernels/scalar_string_test.cc +++ b/cpp/src/arrow/compute/kernels/scalar_string_test.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include - #include #include +#include + #ifdef ARROW_WITH_UTF8PROC #include #endif diff --git a/cpp/src/arrow/compute/kernels/scalar_validity.cc b/cpp/src/arrow/compute/kernels/scalar_validity.cc index 1d399f322bf3d..652afcc0098c9 100644 --- a/cpp/src/arrow/compute/kernels/scalar_validity.cc +++ b/cpp/src/arrow/compute/kernels/scalar_validity.cc @@ -18,7 +18,6 @@ #include #include "arrow/compute/kernels/common.h" - #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_ops.h" diff --git a/cpp/src/arrow/compute/kernels/test_util.h b/cpp/src/arrow/compute/kernels/test_util.h index 767911888ac30..da0dd20505c2d 100644 --- a/cpp/src/arrow/compute/kernels/test_util.h +++ b/cpp/src/arrow/compute/kernels/test_util.h @@ -19,13 +19,14 @@ // IWYU pragma: begin_exports +#include + #include #include #include -#include - #include "arrow/array.h" +#include "arrow/compute/kernel.h" #include "arrow/datum.h" #include "arrow/memory_pool.h" #include "arrow/pretty_print.h" @@ -34,8 +35,6 @@ #include "arrow/testing/util.h" #include "arrow/type.h" -#include "arrow/compute/kernel.h" - // IWYU pragma: end_exports namespace arrow { diff --git a/cpp/src/arrow/compute/kernels/vector_hash_benchmark.cc b/cpp/src/arrow/compute/kernels/vector_hash_benchmark.cc index 3be549d05ce60..995e330e17e27 100644 --- a/cpp/src/arrow/compute/kernels/vector_hash_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/vector_hash_benchmark.cc @@ -15,17 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/array/builder_binary.h" +#include "arrow/compute/api.h" #include "arrow/memory_pool.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/testing/util.h" - -#include "arrow/compute/api.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/vector_hash_test.cc b/cpp/src/arrow/compute/kernels/vector_hash_test.cc index a3fa9314e604f..cba2fba5f2e5f 100644 --- a/cpp/src/arrow/compute/kernels/vector_hash_test.cc +++ b/cpp/src/arrow/compute/kernels/vector_hash_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -26,12 +28,13 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/array/builder_decimal.h" #include "arrow/buffer.h" #include "arrow/chunked_array.h" +#include "arrow/compute/api.h" +#include "arrow/compute/kernels/test_util.h" +#include "arrow/ipc/json_simple.h" #include "arrow/status.h" #include "arrow/testing/gtest_common.h" #include "arrow/testing/util.h" @@ -41,11 +44,6 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/decimal.h" -#include "arrow/compute/api.h" -#include "arrow/compute/kernels/test_util.h" - -#include "arrow/ipc/json_simple.h" - namespace arrow { using internal::checked_cast; diff --git a/cpp/src/arrow/compute/kernels/vector_partition_benchmark.cc b/cpp/src/arrow/compute/kernels/vector_partition_benchmark.cc index ff009c65543a6..439f0a8e183cd 100644 --- a/cpp/src/arrow/compute/kernels/vector_partition_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/vector_partition_benchmark.cc @@ -15,13 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/compute/api_vector.h" #include "arrow/compute/kernels/test_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/vector_selection_benchmark.cc b/cpp/src/arrow/compute/kernels/vector_selection_benchmark.cc index 25e30e65a3526..98585e3cc3c19 100644 --- a/cpp/src/arrow/compute/kernels/vector_selection_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/vector_selection_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include @@ -25,6 +23,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc b/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc index 820c51ba8ec5a..d4ee58cb2847f 100644 --- a/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc +++ b/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/compute/api_vector.h" #include "arrow/compute/kernels/test_util.h" #include "arrow/table.h" @@ -24,6 +22,7 @@ #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" #include "arrow/util/logging.h" +#include "benchmark/benchmark.h" namespace arrow { namespace compute { diff --git a/cpp/src/arrow/compute/registry_test.cc b/cpp/src/arrow/compute/registry_test.cc index e1e0d5231875f..430197dd5e8e5 100644 --- a/cpp/src/arrow/compute/registry_test.cc +++ b/cpp/src/arrow/compute/registry_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/compute/registry.h" + +#include + #include #include #include -#include - #include "arrow/compute/function.h" -#include "arrow/compute/registry.h" #include "arrow/result.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/csv/chunker_test.cc b/cpp/src/arrow/csv/chunker_test.cc index ab565567bdec7..c9688a72aad17 100644 --- a/cpp/src/arrow/csv/chunker_test.cc +++ b/cpp/src/arrow/csv/chunker_test.cc @@ -15,15 +15,16 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/chunker.h" + +#include + #include #include #include #include -#include - #include "arrow/buffer.h" -#include "arrow/csv/chunker.h" #include "arrow/csv/options.h" #include "arrow/csv/test_common.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/csv/column_builder.cc b/cpp/src/arrow/csv/column_builder.cc index 8178b260b4a20..79d273eb3336e 100644 --- a/cpp/src/arrow/csv/column_builder.cc +++ b/cpp/src/arrow/csv/column_builder.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/column_builder.h" + #include #include #include @@ -27,7 +29,6 @@ #include "arrow/array.h" #include "arrow/array/builder_base.h" #include "arrow/chunked_array.h" -#include "arrow/csv/column_builder.h" #include "arrow/csv/converter.h" #include "arrow/csv/inference_internal.h" #include "arrow/csv/options.h" diff --git a/cpp/src/arrow/csv/column_decoder.cc b/cpp/src/arrow/csv/column_decoder.cc index 1dd13bc9086b2..9c3e616520228 100644 --- a/cpp/src/arrow/csv/column_decoder.cc +++ b/cpp/src/arrow/csv/column_decoder.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/column_decoder.h" + #include #include #include @@ -26,7 +28,6 @@ #include "arrow/array.h" #include "arrow/array/builder_base.h" -#include "arrow/csv/column_decoder.h" #include "arrow/csv/converter.h" #include "arrow/csv/inference_internal.h" #include "arrow/csv/options.h" diff --git a/cpp/src/arrow/csv/column_decoder_test.cc b/cpp/src/arrow/csv/column_decoder_test.cc index 231ffb85e1b76..67374041cdc29 100644 --- a/cpp/src/arrow/csv/column_decoder_test.cc +++ b/cpp/src/arrow/csv/column_decoder_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/column_decoder.h" + +#include + #include #include #include #include -#include - -#include "arrow/csv/column_decoder.h" #include "arrow/csv/options.h" #include "arrow/csv/test_common.h" #include "arrow/memory_pool.h" diff --git a/cpp/src/arrow/csv/converter_benchmark.cc b/cpp/src/arrow/csv/converter_benchmark.cc index b7311880d9429..53e6005c33ab9 100644 --- a/cpp/src/arrow/csv/converter_benchmark.cc +++ b/cpp/src/arrow/csv/converter_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include @@ -29,6 +27,7 @@ #include "arrow/io/memory.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/value_parsing.h" +#include "benchmark/benchmark.h" namespace arrow { namespace csv { diff --git a/cpp/src/arrow/csv/parser_benchmark.cc b/cpp/src/arrow/csv/parser_benchmark.cc index b279a3c0ce3c8..13ab55a70318a 100644 --- a/cpp/src/arrow/csv/parser_benchmark.cc +++ b/cpp/src/arrow/csv/parser_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -26,6 +24,7 @@ #include "arrow/csv/parser.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/string_view.h" +#include "benchmark/benchmark.h" namespace arrow { namespace csv { diff --git a/cpp/src/arrow/csv/parser_test.cc b/cpp/src/arrow/csv/parser_test.cc index 6414b379804e2..cb639c76b2332 100644 --- a/cpp/src/arrow/csv/parser_test.cc +++ b/cpp/src/arrow/csv/parser_test.cc @@ -15,15 +15,16 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/parser.h" + +#include + #include #include #include #include -#include - #include "arrow/csv/options.h" -#include "arrow/csv/parser.h" #include "arrow/csv/test_common.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/csv/reader_test.cc b/cpp/src/arrow/csv/reader_test.cc index dbe6b1d4f2092..611f1e7b35c21 100644 --- a/cpp/src/arrow/csv/reader_test.cc +++ b/cpp/src/arrow/csv/reader_test.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/csv/reader.h" + +#include + #include #include #include #include #include -#include - #include "arrow/csv/options.h" -#include "arrow/csv/reader.h" #include "arrow/csv/test_common.h" #include "arrow/io/interfaces.h" #include "arrow/io/memory.h" diff --git a/cpp/src/arrow/csv/test_common.cc b/cpp/src/arrow/csv/test_common.cc index c3d0241aa3861..bd61c96f25ee2 100644 --- a/cpp/src/arrow/csv/test_common.cc +++ b/cpp/src/arrow/csv/test_common.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/csv/test_common.h" + #include "arrow/testing/gtest_util.h" namespace arrow { diff --git a/cpp/src/arrow/csv/writer.cc b/cpp/src/arrow/csv/writer.cc index ddd59b46fc1c9..d2fb4553699c5 100644 --- a/cpp/src/arrow/csv/writer.cc +++ b/cpp/src/arrow/csv/writer.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/csv/writer.h" + #include "arrow/array.h" #include "arrow/compute/cast.h" #include "arrow/io/interfaces.h" @@ -26,7 +27,6 @@ #include "arrow/util/iterator.h" #include "arrow/util/logging.h" #include "arrow/util/make_unique.h" - #include "arrow/visitor_inline.h" namespace arrow { diff --git a/cpp/src/arrow/csv/writer_test.cc b/cpp/src/arrow/csv/writer_test.cc index a49dbcd8268a2..1b7a7d65c94f0 100644 --- a/cpp/src/arrow/csv/writer_test.cc +++ b/cpp/src/arrow/csv/writer_test.cc @@ -15,19 +15,19 @@ // specific language governing permissions and limitations // under the License. -#include "gtest/gtest.h" +#include "arrow/csv/writer.h" #include #include #include "arrow/buffer.h" -#include "arrow/csv/writer.h" #include "arrow/io/memory.h" #include "arrow/record_batch.h" #include "arrow/result_internal.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/type_fwd.h" +#include "gtest/gtest.h" namespace arrow { namespace csv { diff --git a/cpp/src/arrow/dataset/discovery.cc b/cpp/src/arrow/dataset/discovery.cc index 24bc7d9cc31cb..86d3db0ce5c97 100644 --- a/cpp/src/arrow/dataset/discovery.cc +++ b/cpp/src/arrow/dataset/discovery.cc @@ -208,17 +208,15 @@ Result> FileSystemDatasetFactory::Make( } Result> FileSystemDatasetFactory::Make( - std::string uri, - int64_t start_offset, - int64_t length, std::shared_ptr format, - FileSystemFactoryOptions options) { + std::string uri, int64_t start_offset, int64_t length, + std::shared_ptr format, FileSystemFactoryOptions options) { std::string internal_path; ARROW_ASSIGN_OR_RAISE(std::shared_ptr filesystem, arrow::fs::FileSystemFromUri(uri, &internal_path)) ARROW_ASSIGN_OR_RAISE(fs::FileInfo file_info, filesystem->GetFileInfo(internal_path)) return std::shared_ptr(new FileSystemDatasetFactory( - {FileSource(file_info.path(), filesystem, start_offset, length)}, std::move(filesystem), std::move(format), - std::move(options))); + {FileSource(file_info.path(), filesystem, start_offset, length)}, + std::move(filesystem), std::move(format), std::move(options))); } Result>> FileSystemDatasetFactory::InspectSchemas( diff --git a/cpp/src/arrow/dataset/expression_benchmark.cc b/cpp/src/arrow/dataset/expression_benchmark.cc index 24870f38c143c..ae0e60c6cd256 100644 --- a/cpp/src/arrow/dataset/expression_benchmark.cc +++ b/cpp/src/arrow/dataset/expression_benchmark.cc @@ -15,13 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/compute/cast.h" #include "arrow/dataset/expression.h" #include "arrow/dataset/partition.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" +#include "benchmark/benchmark.h" namespace arrow { namespace dataset { diff --git a/cpp/src/arrow/dataset/expression_internal.h b/cpp/src/arrow/dataset/expression_internal.h index 24e60377f5a53..28050fa07a030 100644 --- a/cpp/src/arrow/dataset/expression_internal.h +++ b/cpp/src/arrow/dataset/expression_internal.h @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/dataset/expression.h" - #include #include #include @@ -24,6 +22,7 @@ #include "arrow/compute/api_scalar.h" #include "arrow/compute/cast.h" #include "arrow/compute/registry.h" +#include "arrow/dataset/expression.h" #include "arrow/record_batch.h" #include "arrow/table.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/dataset/expression_test.cc b/cpp/src/arrow/dataset/expression_test.cc index 2ab796b052f62..7b747e5903b14 100644 --- a/cpp/src/arrow/dataset/expression_test.cc +++ b/cpp/src/arrow/dataset/expression_test.cc @@ -17,15 +17,15 @@ #include "arrow/dataset/expression.h" +#include +#include + #include #include #include #include #include -#include -#include - #include "arrow/compute/registry.h" #include "arrow/dataset/expression_internal.h" #include "arrow/dataset/test_util.h" @@ -1028,8 +1028,9 @@ TEST(Expression, SingleComparisonGuarantees) { all = false; } } - Simplify{filter}.WithGuarantee(guarantee).Expect( - all ? literal(true) : none ? literal(false) : filter); + Simplify{filter}.WithGuarantee(guarantee).Expect(all ? literal(true) + : none ? literal(false) + : filter); } } } diff --git a/cpp/src/arrow/dataset/file_base.cc b/cpp/src/arrow/dataset/file_base.cc index 6d087c468fa77..613da20e67134 100644 --- a/cpp/src/arrow/dataset/file_base.cc +++ b/cpp/src/arrow/dataset/file_base.cc @@ -85,10 +85,10 @@ Result> FileSource::OpenCompressed( } Future> FileFormat::CountRows( - const std::shared_ptr& file, Expression predicate, - const std::shared_ptr& options) { - // Just adapt to ORC interface - return Future>::MakeFinished(util::nullopt); + const std::shared_ptr& file, Expression predicate, + const std::shared_ptr& options) { + // Just adapt to ORC interface + return Future>::MakeFinished(util::nullopt); } Result> FileFormat::MakeFragment( @@ -406,7 +406,7 @@ class WriteQueue { } // max_partitions = 1, use the template as the single file's name basename = write_options.basename_template; - } else{ + } else { basename = std::move(replaced); } diff --git a/cpp/src/arrow/dataset/file_base.h b/cpp/src/arrow/dataset/file_base.h index 235bc5c820179..90db22f36a02d 100644 --- a/cpp/src/arrow/dataset/file_base.h +++ b/cpp/src/arrow/dataset/file_base.h @@ -63,8 +63,7 @@ class ARROW_DS_EXPORT FileSource { length_(-1), compression_(compression) {} - FileSource(std::string path, - std::shared_ptr filesystem, + FileSource(std::string path, std::shared_ptr filesystem, int64_t start_offset, int64_t length, Compression::type compression = Compression::UNCOMPRESSED) : file_info_(std::move(path)), @@ -115,13 +114,9 @@ class ARROW_DS_EXPORT FileSource { /// \brief Return the filesystem, if any. Otherwise returns nullptr const std::shared_ptr& filesystem() const { return filesystem_; } - int64_t start_offset() const { - return start_offset_; - } + int64_t start_offset() const { return start_offset_; } - int64_t length() const { - return length_; - } + int64_t length() const { return length_; } /// \brief Return the buffer containing the file, if any. Otherwise returns nullptr const std::shared_ptr& buffer() const { return buffer_; } diff --git a/cpp/src/arrow/dataset/file_benchmark.cc b/cpp/src/arrow/dataset/file_benchmark.cc index 238a83bdc1a39..dccab4623e962 100644 --- a/cpp/src/arrow/dataset/file_benchmark.cc +++ b/cpp/src/arrow/dataset/file_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/dataset/discovery.h" #include "arrow/dataset/expression.h" #include "arrow/dataset/file_base.h" @@ -26,6 +24,7 @@ #include "arrow/filesystem/test_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/iterator.h" +#include "benchmark/benchmark.h" namespace arrow { namespace dataset { diff --git a/cpp/src/arrow/dataset/file_orc.cc b/cpp/src/arrow/dataset/file_orc.cc index 7ab69b59ea2b8..66fdf3d780f82 100644 --- a/cpp/src/arrow/dataset/file_orc.cc +++ b/cpp/src/arrow/dataset/file_orc.cc @@ -85,10 +85,10 @@ class OrcScanTask : public ScanTask { } std::shared_ptr recordBatchReader; - reader->NextBatchReader(scan_options.batch_size, included_fields, &recordBatchReader); - - return RecordBatchIterator( - Impl{std::move(recordBatchReader)}); + reader->NextBatchReader(scan_options.batch_size, included_fields, + &recordBatchReader); + + return RecordBatchIterator(Impl{std::move(recordBatchReader)}); } Result> Next() { @@ -172,13 +172,13 @@ Future> OrcFileFormat::CountRows( // // std::shared_ptr OrcFileFormat::DefaultWriteOptions() { - // TODO (https://issues.apache.org/jira/browse/ARROW-13796) - return nullptr; + // TODO (https://issues.apache.org/jira/browse/ARROW-13796) + return nullptr; } Result> OrcFileFormat::MakeWriter( - std::shared_ptr destination, std::shared_ptr schema, - std::shared_ptr options) const { + std::shared_ptr destination, std::shared_ptr schema, + std::shared_ptr options) const { // TODO (https://issues.apache.org/jira/browse/ARROW-13796) return Status::NotImplemented("ORC writer not yet implemented."); } diff --git a/cpp/src/arrow/dataset/file_orc.h b/cpp/src/arrow/dataset/file_orc.h index a2ad61cb22ec0..01916b3b83e70 100644 --- a/cpp/src/arrow/dataset/file_orc.h +++ b/cpp/src/arrow/dataset/file_orc.h @@ -66,7 +66,7 @@ class ARROW_DS_EXPORT OrcFileFormat : public FileFormat { const std::shared_ptr& options) override; std::shared_ptr DefaultWriteOptions() override; - + Result> MakeWriter( std::shared_ptr destination, std::shared_ptr schema, std::shared_ptr options) const override; diff --git a/cpp/src/arrow/dataset/file_parquet.cc b/cpp/src/arrow/dataset/file_parquet.cc index e9395c408562f..a27f6f85b006b 100644 --- a/cpp/src/arrow/dataset/file_parquet.cc +++ b/cpp/src/arrow/dataset/file_parquet.cc @@ -51,7 +51,6 @@ using parquet::arrow::SchemaField; using parquet::arrow::SchemaManifest; using parquet::arrow::StatisticsAsScalars; - /// \brief A ScanTask backed by a parquet file and a RowGroup within a parquet file. class ParquetScanTask : public ScanTask { public: @@ -498,15 +497,16 @@ Status ParquetFileFragment::EnsureCompleteMetadata(parquet::arrow::FileReader* r r_start = leading_cc->dictionary_page_offset(); } int64_t r_bytes = 0L; - for (int col_id = 0; col_id < parquet_reader->RowGroup(i) - ->metadata()->num_columns(); - col_id++) { - r_bytes += parquet_reader-> - RowGroup(i)->metadata()->ColumnChunk(col_id)->total_compressed_size(); + for (int col_id = 0; + col_id < parquet_reader->RowGroup(i)->metadata()->num_columns(); col_id++) { + r_bytes += parquet_reader->RowGroup(i) + ->metadata() + ->ColumnChunk(col_id) + ->total_compressed_size(); } int64_t midpoint = r_start + r_bytes / 2; - if (midpoint >= source.start_offset() - && midpoint < (source.start_offset() + source.length())) { + if (midpoint >= source.start_offset() && + midpoint < (source.start_offset() + source.length())) { random_read_selected_row_groups.push_back(i); } } diff --git a/cpp/src/arrow/dataset/file_parquet_test.cc b/cpp/src/arrow/dataset/file_parquet_test.cc index bb06e7f2b63ae..f58ae4c92e4d7 100644 --- a/cpp/src/arrow/dataset/file_parquet_test.cc +++ b/cpp/src/arrow/dataset/file_parquet_test.cc @@ -32,7 +32,6 @@ #include "arrow/type.h" #include "arrow/type_fwd.h" #include "arrow/util/range.h" - #include "parquet/arrow/writer.h" #include "parquet/metadata.h" diff --git a/cpp/src/arrow/dataset/file_test.cc b/cpp/src/arrow/dataset/file_test.cc index dbddb5b385b34..365615af3e954 100644 --- a/cpp/src/arrow/dataset/file_test.cc +++ b/cpp/src/arrow/dataset/file_test.cc @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include #include -#include -#include - #include "arrow/dataset/api.h" #include "arrow/dataset/forest_internal.h" #include "arrow/dataset/partition.h" diff --git a/cpp/src/arrow/dataset/scanner.cc b/cpp/src/arrow/dataset/scanner.cc index e45259de89838..5d8d9af4e3b68 100644 --- a/cpp/src/arrow/dataset/scanner.cc +++ b/cpp/src/arrow/dataset/scanner.cc @@ -19,10 +19,10 @@ #include #include +#include #include #include #include -#include #include "arrow/array/array_primitive.h" #include "arrow/compute/api_scalar.h" @@ -301,17 +301,19 @@ Result SyncScanner::ScanBatches() { Result SyncScanner::ScanBatchesWithWeakFilterProject() { ARROW_ASSIGN_OR_RAISE(auto fragment_it, GetFragments()) - auto fn = [this](const std::shared_ptr& fragment) -> Result { + auto fn = + [this](const std::shared_ptr& fragment) -> Result { ARROW_ASSIGN_OR_RAISE(auto scan_task_it, fragment->Scan(scan_options_)); return std::move(scan_task_it); }; // Iterator> auto maybe_scantask_it = MakeMaybeMapIterator(fn, std::move(fragment_it)); auto scan_task_it = MakeFlattenIterator(std::move(maybe_scantask_it)); - - auto scan_fn = [](const std::shared_ptr& aTask)->Result { + + auto scan_fn = + [](const std::shared_ptr& aTask) -> Result { ARROW_ASSIGN_OR_RAISE(auto recordbatch_it, aTask->Execute()); - return std::move(recordbatch_it); + return std::move(recordbatch_it); }; auto maybe_recordbatch_it = MakeMaybeMapIterator(scan_fn, std::move(scan_task_it)); @@ -505,7 +507,8 @@ Result AsyncScanner::ScanBatches() { } Result AsyncScanner::ScanBatchesWithWeakFilterProject() { - return Status::NotImplemented("Scanning with weak filter project not implemented in async scanner"); + return Status::NotImplemented( + "Scanning with weak filter project not implemented in async scanner"); } Result AsyncScanner::ScanBatchesUnordered() { diff --git a/cpp/src/arrow/dataset/scanner_internal.h b/cpp/src/arrow/dataset/scanner_internal.h index 4d11ed00fc180..e2cfd98364743 100644 --- a/cpp/src/arrow/dataset/scanner_internal.h +++ b/cpp/src/arrow/dataset/scanner_internal.h @@ -116,7 +116,8 @@ class FilterAndProjectScanTask : public ScanTask { class ProjectScanTask : public ScanTask { public: explicit ProjectScanTask(std::shared_ptr task, Expression partition) - : ScanTask(task->options(), task->fragment()), task_(std::move(task)), + : ScanTask(task->options(), task->fragment()), + task_(std::move(task)), partition_(std::move(partition)) {} Result Execute() override { diff --git a/cpp/src/arrow/dataset/scanner_test.cc b/cpp/src/arrow/dataset/scanner_test.cc index 27fcef1f04ce6..bd3bd0692eb96 100644 --- a/cpp/src/arrow/dataset/scanner_test.cc +++ b/cpp/src/arrow/dataset/scanner_test.cc @@ -17,11 +17,11 @@ #include "arrow/dataset/scanner.h" +#include + #include #include -#include - #include "arrow/compute/api.h" #include "arrow/compute/api_scalar.h" #include "arrow/compute/api_vector.h" diff --git a/cpp/src/arrow/dataset/test_util.h b/cpp/src/arrow/dataset/test_util.h index b94441e178ab8..64c6a66e83c6b 100644 --- a/cpp/src/arrow/dataset/test_util.h +++ b/cpp/src/arrow/dataset/test_util.h @@ -17,6 +17,9 @@ #pragma once +#include +#include + #include #include #include @@ -27,9 +30,6 @@ #include #include -#include -#include - #include "arrow/dataset/dataset_internal.h" #include "arrow/dataset/discovery.h" #include "arrow/dataset/file_base.h" diff --git a/cpp/src/arrow/datum_test.cc b/cpp/src/arrow/datum_test.cc index cf65d515ddac5..0313451620935 100644 --- a/cpp/src/arrow/datum_test.cc +++ b/cpp/src/arrow/datum_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "arrow/datum.h" #include +#include +#include + #include "arrow/array/array_base.h" #include "arrow/chunked_array.h" -#include "arrow/datum.h" #include "arrow/scalar.h" #include "arrow/table.h" #include "arrow/testing/gtest_common.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/api.h b/cpp/src/arrow/dbi/hiveserver2/api.h index da860e6d8c7b8..9404308b8804c 100644 --- a/cpp/src/arrow/dbi/hiveserver2/api.h +++ b/cpp/src/arrow/dbi/hiveserver2/api.h @@ -23,5 +23,4 @@ #include "arrow/dbi/hiveserver2/session.h" #include "arrow/dbi/hiveserver2/types.h" #include "arrow/dbi/hiveserver2/util.h" - #include "arrow/status.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/columnar_row_set.cc b/cpp/src/arrow/dbi/hiveserver2/columnar_row_set.cc index bef894014aba2..8769d5e19a32b 100644 --- a/cpp/src/arrow/dbi/hiveserver2/columnar_row_set.cc +++ b/cpp/src/arrow/dbi/hiveserver2/columnar_row_set.cc @@ -22,7 +22,6 @@ #include "arrow/dbi/hiveserver2/TCLIService.h" #include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/util/logging.h" namespace hs2 = apache::hive::service::cli::thrift; diff --git a/cpp/src/arrow/dbi/hiveserver2/hiveserver2_test.cc b/cpp/src/arrow/dbi/hiveserver2/hiveserver2_test.cc index c19ec1c80a7c8..833e9c6dda686 100644 --- a/cpp/src/arrow/dbi/hiveserver2/hiveserver2_test.cc +++ b/cpp/src/arrow/dbi/hiveserver2/hiveserver2_test.cc @@ -15,19 +15,17 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/dbi/hiveserver2/operation.h" +#include #include #include #include #include -#include - +#include "arrow/dbi/hiveserver2/operation.h" #include "arrow/dbi/hiveserver2/service.h" #include "arrow/dbi/hiveserver2/session.h" #include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/status.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/operation.cc b/cpp/src/arrow/dbi/hiveserver2/operation.cc index 3a5cceb25f717..171a3ca29a9d9 100644 --- a/cpp/src/arrow/dbi/hiveserver2/operation.cc +++ b/cpp/src/arrow/dbi/hiveserver2/operation.cc @@ -17,11 +17,9 @@ #include "arrow/dbi/hiveserver2/operation.h" -#include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/dbi/hiveserver2/ImpalaService_types.h" #include "arrow/dbi/hiveserver2/TCLIService.h" - +#include "arrow/dbi/hiveserver2/thrift_internal.h" #include "arrow/status.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/operation.h b/cpp/src/arrow/dbi/hiveserver2/operation.h index 3efe6665963ef..1f2e646d00dcf 100644 --- a/cpp/src/arrow/dbi/hiveserver2/operation.h +++ b/cpp/src/arrow/dbi/hiveserver2/operation.h @@ -23,7 +23,6 @@ #include "arrow/dbi/hiveserver2/columnar_row_set.h" #include "arrow/dbi/hiveserver2/types.h" - #include "arrow/util/macros.h" #include "arrow/util/visibility.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/service.cc b/cpp/src/arrow/dbi/hiveserver2/service.cc index 8ac19a8d36868..818eda2666dae 100644 --- a/cpp/src/arrow/dbi/hiveserver2/service.cc +++ b/cpp/src/arrow/dbi/hiveserver2/service.cc @@ -20,14 +20,13 @@ #include #include #include -#include -#include "arrow/dbi/hiveserver2/session.h" -#include "arrow/dbi/hiveserver2/thrift_internal.h" +#include #include "arrow/dbi/hiveserver2/ImpalaHiveServer2Service.h" #include "arrow/dbi/hiveserver2/TCLIService.h" - +#include "arrow/dbi/hiveserver2/session.h" +#include "arrow/dbi/hiveserver2/thrift_internal.h" #include "arrow/status.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/session.cc b/cpp/src/arrow/dbi/hiveserver2/session.cc index 069f0727530dc..09900cd429308 100644 --- a/cpp/src/arrow/dbi/hiveserver2/session.cc +++ b/cpp/src/arrow/dbi/hiveserver2/session.cc @@ -19,7 +19,6 @@ #include "arrow/dbi/hiveserver2/TCLIService.h" #include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/status.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/session.h b/cpp/src/arrow/dbi/hiveserver2/session.h index 4e223de6c1775..8790f286081ad 100644 --- a/cpp/src/arrow/dbi/hiveserver2/session.h +++ b/cpp/src/arrow/dbi/hiveserver2/session.h @@ -22,7 +22,6 @@ #include "arrow/dbi/hiveserver2/operation.h" #include "arrow/dbi/hiveserver2/service.h" - #include "arrow/util/visibility.h" namespace arrow { diff --git a/cpp/src/arrow/dbi/hiveserver2/thrift_internal.cc b/cpp/src/arrow/dbi/hiveserver2/thrift_internal.cc index 91cd51e58a4ac..f4eacf19782f4 100644 --- a/cpp/src/arrow/dbi/hiveserver2/thrift_internal.cc +++ b/cpp/src/arrow/dbi/hiveserver2/thrift_internal.cc @@ -22,7 +22,6 @@ #include "arrow/dbi/hiveserver2/TCLIService_constants.h" #include "arrow/dbi/hiveserver2/service.h" - #include "arrow/status.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/dbi/hiveserver2/thrift_internal.h b/cpp/src/arrow/dbi/hiveserver2/thrift_internal.h index 44b6f3642a3ec..23ee53496bcc3 100644 --- a/cpp/src/arrow/dbi/hiveserver2/thrift_internal.h +++ b/cpp/src/arrow/dbi/hiveserver2/thrift_internal.h @@ -20,14 +20,13 @@ #include #include +#include "arrow/dbi/hiveserver2/ImpalaHiveServer2Service.h" +#include "arrow/dbi/hiveserver2/TCLIService.h" #include "arrow/dbi/hiveserver2/columnar_row_set.h" #include "arrow/dbi/hiveserver2/operation.h" #include "arrow/dbi/hiveserver2/service.h" #include "arrow/dbi/hiveserver2/types.h" -#include "arrow/dbi/hiveserver2/ImpalaHiveServer2Service.h" -#include "arrow/dbi/hiveserver2/TCLIService.h" - namespace arrow { namespace hiveserver2 { diff --git a/cpp/src/arrow/dbi/hiveserver2/types.cc b/cpp/src/arrow/dbi/hiveserver2/types.cc index ef2a02ecb1580..dc142beb2488c 100644 --- a/cpp/src/arrow/dbi/hiveserver2/types.cc +++ b/cpp/src/arrow/dbi/hiveserver2/types.cc @@ -18,7 +18,6 @@ #include "arrow/dbi/hiveserver2/types.h" #include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/util/logging.h" namespace arrow { diff --git a/cpp/src/arrow/dbi/hiveserver2/util.cc b/cpp/src/arrow/dbi/hiveserver2/util.cc index 772be4e38c551..3f754c0f6d634 100644 --- a/cpp/src/arrow/dbi/hiveserver2/util.cc +++ b/cpp/src/arrow/dbi/hiveserver2/util.cc @@ -22,12 +22,10 @@ #include #include -#include "arrow/dbi/hiveserver2/columnar_row_set.h" -#include "arrow/dbi/hiveserver2/thrift_internal.h" - #include "arrow/dbi/hiveserver2/TCLIService.h" #include "arrow/dbi/hiveserver2/TCLIService_types.h" - +#include "arrow/dbi/hiveserver2/columnar_row_set.h" +#include "arrow/dbi/hiveserver2/thrift_internal.h" #include "arrow/status.h" namespace hs2 = apache::hive::service::cli::thrift; diff --git a/cpp/src/arrow/extension_type_test.cc b/cpp/src/arrow/extension_type_test.cc index cd1c3b9790e76..854f95c1fa4b0 100644 --- a/cpp/src/arrow/extension_type_test.cc +++ b/cpp/src/arrow/extension_type_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/extension_type.h" + +#include + #include #include #include @@ -22,11 +26,8 @@ #include #include -#include - #include "arrow/array/array_nested.h" #include "arrow/array/util.h" -#include "arrow/extension_type.h" #include "arrow/io/memory.h" #include "arrow/ipc/options.h" #include "arrow/ipc/reader.h" diff --git a/cpp/src/arrow/filesystem/api.h b/cpp/src/arrow/filesystem/api.h index 5b0c97d150abb..518f8ba11b89c 100644 --- a/cpp/src/arrow/filesystem/api.h +++ b/cpp/src/arrow/filesystem/api.h @@ -17,12 +17,11 @@ #pragma once -#include "arrow/util/config.h" // IWYU pragma: export - #include "arrow/filesystem/filesystem.h" // IWYU pragma: export #include "arrow/filesystem/hdfs.h" // IWYU pragma: export #include "arrow/filesystem/localfs.h" // IWYU pragma: export #include "arrow/filesystem/mockfs.h" // IWYU pragma: export +#include "arrow/util/config.h" // IWYU pragma: export #ifdef ARROW_S3 #include "arrow/filesystem/s3fs.h" // IWYU pragma: export #endif diff --git a/cpp/src/arrow/filesystem/filesystem.cc b/cpp/src/arrow/filesystem/filesystem.cc index 98dc05731b9a9..bf15a6fe6f167 100644 --- a/cpp/src/arrow/filesystem/filesystem.cc +++ b/cpp/src/arrow/filesystem/filesystem.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/filesystem.h" + #include #include #include "arrow/util/config.h" - -#include "arrow/filesystem/filesystem.h" #ifdef ARROW_HDFS #include "arrow/filesystem/hdfs.h" #endif diff --git a/cpp/src/arrow/filesystem/filesystem_test.cc b/cpp/src/arrow/filesystem/filesystem_test.cc index 8df84ff91e65f..e738f79a5f884 100644 --- a/cpp/src/arrow/filesystem/filesystem_test.cc +++ b/cpp/src/arrow/filesystem/filesystem_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/filesystem.h" + +#include + #include #include #include #include -#include - -#include "arrow/filesystem/filesystem.h" #include "arrow/filesystem/mockfs.h" #include "arrow/filesystem/path_util.h" #include "arrow/filesystem/test_util.h" diff --git a/cpp/src/arrow/filesystem/hdfs.cc b/cpp/src/arrow/filesystem/hdfs.cc index 6ac81d012755a..0b5f68d483f59 100644 --- a/cpp/src/arrow/filesystem/hdfs.cc +++ b/cpp/src/arrow/filesystem/hdfs.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/hdfs.h" + #include #include #include #include -#include "arrow/filesystem/hdfs.h" #include "arrow/filesystem/path_util.h" #include "arrow/filesystem/util_internal.h" #include "arrow/io/hdfs.h" diff --git a/cpp/src/arrow/filesystem/hdfs_test.cc b/cpp/src/arrow/filesystem/hdfs_test.cc index 8215455613a46..a59efc65cb744 100644 --- a/cpp/src/arrow/filesystem/hdfs_test.cc +++ b/cpp/src/arrow/filesystem/hdfs_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/hdfs.h" + +#include + #include #include #include -#include - -#include "arrow/filesystem/hdfs.h" #include "arrow/filesystem/test_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" diff --git a/cpp/src/arrow/filesystem/localfs_test.cc b/cpp/src/arrow/filesystem/localfs_test.cc index e338160951a7b..563af13b095d5 100644 --- a/cpp/src/arrow/filesystem/localfs_test.cc +++ b/cpp/src/arrow/filesystem/localfs_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/localfs.h" + +#include + #include #include #include @@ -22,10 +26,7 @@ #include #include -#include - #include "arrow/filesystem/filesystem.h" -#include "arrow/filesystem/localfs.h" #include "arrow/filesystem/path_util.h" #include "arrow/filesystem/test_util.h" #include "arrow/filesystem/util_internal.h" diff --git a/cpp/src/arrow/filesystem/mockfs.cc b/cpp/src/arrow/filesystem/mockfs.cc index e1ac05ced5418..68347c3d278c9 100644 --- a/cpp/src/arrow/filesystem/mockfs.cc +++ b/cpp/src/arrow/filesystem/mockfs.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/mockfs.h" + #include #include #include @@ -26,7 +28,6 @@ #include "arrow/buffer.h" #include "arrow/buffer_builder.h" -#include "arrow/filesystem/mockfs.h" #include "arrow/filesystem/path_util.h" #include "arrow/filesystem/util_internal.h" #include "arrow/io/interfaces.h" diff --git a/cpp/src/arrow/filesystem/path_util.cc b/cpp/src/arrow/filesystem/path_util.cc index f1bd5c087bf95..539031f977f85 100644 --- a/cpp/src/arrow/filesystem/path_util.cc +++ b/cpp/src/arrow/filesystem/path_util.cc @@ -15,9 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/path_util.h" + #include -#include "arrow/filesystem/path_util.h" #include "arrow/result.h" #include "arrow/status.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/filesystem/s3_internal.h b/cpp/src/arrow/filesystem/s3_internal.h index b7b6f31420769..b35eeef7de7ee 100644 --- a/cpp/src/arrow/filesystem/s3_internal.h +++ b/cpp/src/arrow/filesystem/s3_internal.h @@ -17,17 +17,17 @@ #pragma once -#include -#include -#include -#include - #include #include #include #include #include +#include +#include +#include +#include + #include "arrow/filesystem/filesystem.h" #include "arrow/status.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/filesystem/s3_test_util.h b/cpp/src/arrow/filesystem/s3_test_util.h index 2bb614b9b8087..432ff1d22ff35 100644 --- a/cpp/src/arrow/filesystem/s3_test_util.h +++ b/cpp/src/arrow/filesystem/s3_test_util.h @@ -25,11 +25,10 @@ // We need BOOST_USE_WINDOWS_H definition with MinGW when we use // boost/process.hpp. See ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS in // cpp/cmake_modules/BuildUtils.cmake for details. -#include - +#include #include -#include +#include #include "arrow/filesystem/s3fs.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/filesystem/s3fs_benchmark.cc b/cpp/src/arrow/filesystem/s3fs_benchmark.cc index 36564a70d2907..678b44d4f6c2d 100644 --- a/cpp/src/arrow/filesystem/s3fs_benchmark.cc +++ b/cpp/src/arrow/filesystem/s3fs_benchmark.cc @@ -15,18 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include - -#include "benchmark/benchmark.h" - #include #include #include #include #include +#include +#include +#include + #include "arrow/filesystem/s3_internal.h" #include "arrow/filesystem/s3_test_util.h" #include "arrow/filesystem/s3fs.h" @@ -38,7 +36,7 @@ #include "arrow/testing/random.h" #include "arrow/util/key_value_metadata.h" #include "arrow/util/range.h" - +#include "benchmark/benchmark.h" #include "parquet/arrow/reader.h" #include "parquet/arrow/writer.h" #include "parquet/properties.h" diff --git a/cpp/src/arrow/filesystem/s3fs_narrative_test.cc b/cpp/src/arrow/filesystem/s3fs_narrative_test.cc index f65ccba02bb1a..3cde2f33e3f3f 100644 --- a/cpp/src/arrow/filesystem/s3fs_narrative_test.cc +++ b/cpp/src/arrow/filesystem/s3fs_narrative_test.cc @@ -19,12 +19,12 @@ // The test bucket must exist and be empty (you can use --clear to delete its // contents). +#include + #include #include #include -#include - #include "arrow/filesystem/s3fs.h" #include "arrow/filesystem/test_util.h" #include "arrow/io/interfaces.h" diff --git a/cpp/src/arrow/filesystem/s3fs_test.cc b/cpp/src/arrow/filesystem/s3fs_test.cc index f5efcda512059..f0b29b2f46c87 100644 --- a/cpp/src/arrow/filesystem/s3fs_test.cc +++ b/cpp/src/arrow/filesystem/s3fs_test.cc @@ -36,11 +36,11 @@ // We need BOOST_USE_WINDOWS_H definition with MinGW when we use // boost/process.hpp. See ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS in // cpp/cmake_modules/BuildUtils.cmake for details. -#include - #include #include +#include + #ifdef _WIN32 // Undefine preprocessor macros that interfere with AWS function / method names #ifdef GetMessage diff --git a/cpp/src/arrow/filesystem/test_util.cc b/cpp/src/arrow/filesystem/test_util.cc index 466b8826aefc9..abee83df6aef2 100644 --- a/cpp/src/arrow/filesystem/test_util.cc +++ b/cpp/src/arrow/filesystem/test_util.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/filesystem/test_util.h" + +#include +#include + #include #include #include #include #include -#include -#include - -#include "arrow/filesystem/test_util.h" #include "arrow/filesystem/util_internal.h" #include "arrow/io/interfaces.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/filesystem/util_internal.cc b/cpp/src/arrow/filesystem/util_internal.cc index 8f86707375d43..f62039f2fd38e 100644 --- a/cpp/src/arrow/filesystem/util_internal.cc +++ b/cpp/src/arrow/filesystem/util_internal.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/filesystem/util_internal.h" + #include "arrow/buffer.h" #include "arrow/result.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/flight/client.cc b/cpp/src/arrow/flight/client.cc index c0e8eaaed28cc..baf4a59677757 100644 --- a/cpp/src/arrow/flight/client.cc +++ b/cpp/src/arrow/flight/client.cc @@ -18,8 +18,6 @@ #include "arrow/flight/client.h" // Platform-specific defines -#include "arrow/flight/platform.h" - #include #include #include @@ -28,6 +26,8 @@ #include #include +#include "arrow/flight/platform.h" + #ifdef GRPCPP_PP_INCLUDE #include #if defined(GRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS) @@ -40,15 +40,6 @@ #include #include "arrow/buffer.h" -#include "arrow/ipc/reader.h" -#include "arrow/ipc/writer.h" -#include "arrow/record_batch.h" -#include "arrow/result.h" -#include "arrow/status.h" -#include "arrow/type.h" -#include "arrow/util/logging.h" -#include "arrow/util/uri.h" - #include "arrow/flight/client_auth.h" #include "arrow/flight/client_header_internal.h" #include "arrow/flight/client_middleware.h" @@ -57,6 +48,14 @@ #include "arrow/flight/middleware_internal.h" #include "arrow/flight/serialization_internal.h" #include "arrow/flight/types.h" +#include "arrow/ipc/reader.h" +#include "arrow/ipc/writer.h" +#include "arrow/record_batch.h" +#include "arrow/result.h" +#include "arrow/status.h" +#include "arrow/type.h" +#include "arrow/util/logging.h" +#include "arrow/util/uri.h" namespace arrow { diff --git a/cpp/src/arrow/flight/client.h b/cpp/src/arrow/flight/client.h index b3c5a96e59793..2a6db07d9b746 100644 --- a/cpp/src/arrow/flight/client.h +++ b/cpp/src/arrow/flight/client.h @@ -26,6 +26,8 @@ #include #include +#include "arrow/flight/types.h" // IWYU pragma: keep +#include "arrow/flight/visibility.h" #include "arrow/ipc/options.h" #include "arrow/ipc/reader.h" #include "arrow/ipc/writer.h" @@ -33,9 +35,6 @@ #include "arrow/status.h" #include "arrow/util/variant.h" -#include "arrow/flight/types.h" // IWYU pragma: keep -#include "arrow/flight/visibility.h" - namespace arrow { class RecordBatch; diff --git a/cpp/src/arrow/flight/client_cookie_middleware.cc b/cpp/src/arrow/flight/client_cookie_middleware.cc index 145705e971548..3eecce36b9784 100644 --- a/cpp/src/arrow/flight/client_cookie_middleware.cc +++ b/cpp/src/arrow/flight/client_cookie_middleware.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/flight/client_cookie_middleware.h" + #include "arrow/flight/client_header_internal.h" #include "arrow/util/value_parsing.h" diff --git a/cpp/src/arrow/flight/client_header_internal.cc b/cpp/src/arrow/flight/client_header_internal.cc index 3ee0efa82d4ee..bb927a81da866 100644 --- a/cpp/src/arrow/flight/client_header_internal.cc +++ b/cpp/src/arrow/flight/client_header_internal.cc @@ -19,6 +19,7 @@ // experimental. #include "arrow/flight/client_header_internal.h" + #include "arrow/flight/client.h" #include "arrow/flight/client_auth.h" #include "arrow/flight/platform.h" diff --git a/cpp/src/arrow/flight/flight_benchmark.cc b/cpp/src/arrow/flight/flight_benchmark.cc index f9f60c40c9141..8fa21b7e43cc7 100644 --- a/cpp/src/arrow/flight/flight_benchmark.cc +++ b/cpp/src/arrow/flight/flight_benchmark.cc @@ -15,14 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include #include -#include - +#include "arrow/flight/api.h" +#include "arrow/flight/perf.pb.h" +#include "arrow/flight/test_util.h" #include "arrow/io/memory.h" #include "arrow/ipc/api.h" #include "arrow/record_batch.h" @@ -32,10 +35,6 @@ #include "arrow/util/tdigest.h" #include "arrow/util/thread_pool.h" -#include "arrow/flight/api.h" -#include "arrow/flight/perf.pb.h" -#include "arrow/flight/test_util.h" - DEFINE_string(server_host, "", "An existing performance server to benchmark against (leave blank to spawn " "one automatically)"); diff --git a/cpp/src/arrow/flight/middleware_internal.h b/cpp/src/arrow/flight/middleware_internal.h index 8ee76476a46e8..661facb1310cc 100644 --- a/cpp/src/arrow/flight/middleware_internal.h +++ b/cpp/src/arrow/flight/middleware_internal.h @@ -20,13 +20,13 @@ #pragma once -#include "arrow/flight/platform.h" -#include "arrow/flight/visibility.h" // IWYU pragma: keep - #include #include #include +#include "arrow/flight/platform.h" +#include "arrow/flight/visibility.h" // IWYU pragma: keep + #ifdef GRPCPP_PP_INCLUDE #include #else diff --git a/cpp/src/arrow/flight/perf_server.cc b/cpp/src/arrow/flight/perf_server.cc index b9814035b3b36..7cdde4fe6b0bb 100644 --- a/cpp/src/arrow/flight/perf_server.cc +++ b/cpp/src/arrow/flight/perf_server.cc @@ -17,15 +17,19 @@ // Performance server for benchmarking purposes +#include #include + #include #include #include #include -#include - #include "arrow/array.h" +#include "arrow/flight/api.h" +#include "arrow/flight/internal.h" +#include "arrow/flight/perf.pb.h" +#include "arrow/flight/test_util.h" #include "arrow/io/test_common.h" #include "arrow/ipc/writer.h" #include "arrow/record_batch.h" @@ -33,11 +37,6 @@ #include "arrow/testing/util.h" #include "arrow/util/logging.h" -#include "arrow/flight/api.h" -#include "arrow/flight/internal.h" -#include "arrow/flight/perf.pb.h" -#include "arrow/flight/test_util.h" - DEFINE_string(server_host, "localhost", "Host where the server is running on"); DEFINE_int32(port, 31337, "Server port to listen on"); DEFINE_string(server_unix, "", "Unix socket path where the server is running on"); diff --git a/cpp/src/arrow/flight/protocol_internal.h b/cpp/src/arrow/flight/protocol_internal.h index 98bf923880934..109851c7ff3c2 100644 --- a/cpp/src/arrow/flight/protocol_internal.h +++ b/cpp/src/arrow/flight/protocol_internal.h @@ -22,7 +22,6 @@ // This header holds the Flight protobuf definitions. // Need to include this first to get our gRPC customizations +#include "arrow/flight/Flight.grpc.pb.h" // IWYU pragma: export +#include "arrow/flight/Flight.pb.h" // IWYU pragma: export #include "arrow/flight/customize_protobuf.h" // IWYU pragma: export - -#include "arrow/flight/Flight.grpc.pb.h" // IWYU pragma: export -#include "arrow/flight/Flight.pb.h" // IWYU pragma: export diff --git a/cpp/src/arrow/flight/serialization_internal.cc b/cpp/src/arrow/flight/serialization_internal.cc index 8c6b737c7e5d0..6757c178b519a 100644 --- a/cpp/src/arrow/flight/serialization_internal.cc +++ b/cpp/src/arrow/flight/serialization_internal.cc @@ -32,7 +32,6 @@ #include #include #include - #include #ifdef GRPCPP_PP_INCLUDE #include diff --git a/cpp/src/arrow/flight/server.cc b/cpp/src/arrow/flight/server.cc index ce5a07fc3e0f0..32f32aaba2d14 100644 --- a/cpp/src/arrow/flight/server.cc +++ b/cpp/src/arrow/flight/server.cc @@ -16,10 +16,10 @@ // under the License. // Platform-specific defines -#include "arrow/flight/platform.h" - #include "arrow/flight/server.h" +#include "arrow/flight/platform.h" + #ifdef _WIN32 #include #else @@ -43,6 +43,13 @@ #endif #include "arrow/buffer.h" +#include "arrow/flight/internal.h" +#include "arrow/flight/middleware.h" +#include "arrow/flight/middleware_internal.h" +#include "arrow/flight/serialization_internal.h" +#include "arrow/flight/server_auth.h" +#include "arrow/flight/server_middleware.h" +#include "arrow/flight/types.h" #include "arrow/ipc/dictionary.h" #include "arrow/ipc/options.h" #include "arrow/ipc/reader.h" @@ -54,14 +61,6 @@ #include "arrow/util/logging.h" #include "arrow/util/uri.h" -#include "arrow/flight/internal.h" -#include "arrow/flight/middleware.h" -#include "arrow/flight/middleware_internal.h" -#include "arrow/flight/serialization_internal.h" -#include "arrow/flight/server_auth.h" -#include "arrow/flight/server_middleware.h" -#include "arrow/flight/types.h" - using FlightService = arrow::flight::protocol::FlightService; using ServerContext = grpc::ServerContext; diff --git a/cpp/src/arrow/flight/test_integration.cc b/cpp/src/arrow/flight/test_integration.cc index 29ce5601f375b..3c34273036ee9 100644 --- a/cpp/src/arrow/flight/test_integration.cc +++ b/cpp/src/arrow/flight/test_integration.cc @@ -16,11 +16,6 @@ // under the License. #include "arrow/flight/test_integration.h" -#include "arrow/flight/client_middleware.h" -#include "arrow/flight/server_middleware.h" -#include "arrow/flight/test_util.h" -#include "arrow/flight/types.h" -#include "arrow/ipc/dictionary.h" #include #include @@ -28,6 +23,12 @@ #include #include +#include "arrow/flight/client_middleware.h" +#include "arrow/flight/server_middleware.h" +#include "arrow/flight/test_util.h" +#include "arrow/flight/types.h" +#include "arrow/ipc/dictionary.h" + namespace arrow { namespace flight { diff --git a/cpp/src/arrow/flight/test_integration.h b/cpp/src/arrow/flight/test_integration.h index 5d9bd7fd7bd74..b3c19d756f76e 100644 --- a/cpp/src/arrow/flight/test_integration.h +++ b/cpp/src/arrow/flight/test_integration.h @@ -17,13 +17,12 @@ // Integration test scenarios for Arrow Flight. -#include "arrow/flight/visibility.h" - #include #include #include "arrow/flight/client.h" #include "arrow/flight/server.h" +#include "arrow/flight/visibility.h" #include "arrow/status.h" namespace arrow { diff --git a/cpp/src/arrow/flight/test_integration_client.cc b/cpp/src/arrow/flight/test_integration_client.cc index 6c1d69046037f..028cb00443fbc 100644 --- a/cpp/src/arrow/flight/test_integration_client.cc +++ b/cpp/src/arrow/flight/test_integration_client.cc @@ -21,14 +21,17 @@ // client then requests the data from the server and compares it to // the data originally uploaded. +#include + #include #include #include #include #include -#include - +#include "arrow/flight/api.h" +#include "arrow/flight/test_integration.h" +#include "arrow/flight/test_util.h" #include "arrow/io/file.h" #include "arrow/io/test_common.h" #include "arrow/ipc/dictionary.h" @@ -40,10 +43,6 @@ #include "arrow/testing/json_integration.h" #include "arrow/util/logging.h" -#include "arrow/flight/api.h" -#include "arrow/flight/test_integration.h" -#include "arrow/flight/test_util.h" - DEFINE_string(host, "localhost", "Server port to connect to"); DEFINE_int32(port, 31337, "Server port to connect to"); DEFINE_string(path, "", "Resource path to request"); diff --git a/cpp/src/arrow/flight/test_integration_server.cc b/cpp/src/arrow/flight/test_integration_server.cc index 4b904b0eba13a..ca73736e2ca5d 100644 --- a/cpp/src/arrow/flight/test_integration_server.cc +++ b/cpp/src/arrow/flight/test_integration_server.cc @@ -21,24 +21,23 @@ // validates that Arrow data survives a round-trip through a Flight // service. The latter tests specific features of Arrow Flight. +#include #include + #include #include #include -#include - -#include "arrow/io/test_common.h" -#include "arrow/record_batch.h" -#include "arrow/table.h" -#include "arrow/testing/json_integration.h" -#include "arrow/util/logging.h" - #include "arrow/flight/internal.h" #include "arrow/flight/server.h" #include "arrow/flight/server_auth.h" #include "arrow/flight/test_integration.h" #include "arrow/flight/test_util.h" +#include "arrow/io/test_common.h" +#include "arrow/record_batch.h" +#include "arrow/table.h" +#include "arrow/testing/json_integration.h" +#include "arrow/util/logging.h" DEFINE_int32(port, 31337, "Server port to listen on"); DEFINE_string(scenario, "", "Integration test senario to run"); diff --git a/cpp/src/arrow/flight/test_server.cc b/cpp/src/arrow/flight/test_server.cc index 2e5b10f840388..9bd85063b8ba4 100644 --- a/cpp/src/arrow/flight/test_server.cc +++ b/cpp/src/arrow/flight/test_server.cc @@ -18,13 +18,13 @@ // Example server implementation to use for unit testing and benchmarking // purposes +#include #include + #include #include #include -#include - #include "arrow/flight/server.h" #include "arrow/flight/test_util.h" #include "arrow/flight/types.h" diff --git a/cpp/src/arrow/flight/test_util.cc b/cpp/src/arrow/flight/test_util.cc index 51267c5c0c1d2..575ef2ae5d66a 100644 --- a/cpp/src/arrow/flight/test_util.cc +++ b/cpp/src/arrow/flight/test_util.cc @@ -22,27 +22,25 @@ #include #endif +#include #include #include - -#include // We need BOOST_USE_WINDOWS_H definition with MinGW when we use // boost/process.hpp. See ARROW_BOOST_PROCESS_COMPILE_DEFINITIONS in // cpp/cmake_modules/BuildUtils.cmake for details. -#include - #include +#include + +#include "arrow/flight/api.h" +#include "arrow/flight/internal.h" +#include "arrow/flight/test_util.h" #include "arrow/ipc/test_common.h" #include "arrow/testing/generator.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" #include "arrow/util/logging.h" -#include "arrow/flight/api.h" -#include "arrow/flight/internal.h" -#include "arrow/flight/test_util.h" - namespace arrow { namespace flight { diff --git a/cpp/src/arrow/flight/test_util.h b/cpp/src/arrow/flight/test_util.h index 21c48eabf7e88..5fe28dc7f15d7 100644 --- a/cpp/src/arrow/flight/test_util.h +++ b/cpp/src/arrow/flight/test_util.h @@ -24,14 +24,13 @@ #include #include -#include "arrow/status.h" -#include "arrow/testing/util.h" - #include "arrow/flight/client_auth.h" #include "arrow/flight/server.h" #include "arrow/flight/server_auth.h" #include "arrow/flight/types.h" #include "arrow/flight/visibility.h" +#include "arrow/status.h" +#include "arrow/testing/util.h" namespace boost { namespace process { diff --git a/cpp/src/arrow/gpu/cuda_arrow_ipc.cc b/cpp/src/arrow/gpu/cuda_arrow_ipc.cc index a928df0139b50..a8a2e5c44bda7 100644 --- a/cpp/src/arrow/gpu/cuda_arrow_ipc.cc +++ b/cpp/src/arrow/gpu/cuda_arrow_ipc.cc @@ -23,6 +23,8 @@ #include #include "arrow/buffer.h" +#include "arrow/gpu/cuda_context.h" +#include "arrow/gpu/cuda_memory.h" #include "arrow/ipc/dictionary.h" #include "arrow/ipc/message.h" #include "arrow/ipc/reader.h" @@ -30,12 +32,8 @@ #include "arrow/record_batch.h" #include "arrow/status.h" #include "arrow/util/visibility.h" - #include "generated/Message_generated.h" -#include "arrow/gpu/cuda_context.h" -#include "arrow/gpu/cuda_memory.h" - namespace arrow { namespace flatbuf = org::apache::arrow::flatbuf; diff --git a/cpp/src/arrow/gpu/cuda_arrow_ipc.h b/cpp/src/arrow/gpu/cuda_arrow_ipc.h index b7200a94b93dd..47cf96f2ca4a1 100644 --- a/cpp/src/arrow/gpu/cuda_arrow_ipc.h +++ b/cpp/src/arrow/gpu/cuda_arrow_ipc.h @@ -21,11 +21,10 @@ #include #include "arrow/buffer.h" +#include "arrow/gpu/cuda_memory.h" #include "arrow/type_fwd.h" #include "arrow/util/visibility.h" -#include "arrow/gpu/cuda_memory.h" - namespace arrow { class MemoryPool; diff --git a/cpp/src/arrow/gpu/cuda_benchmark.cc b/cpp/src/arrow/gpu/cuda_benchmark.cc index 2787d103cc7ce..991db2999973e 100644 --- a/cpp/src/arrow/gpu/cuda_benchmark.cc +++ b/cpp/src/arrow/gpu/cuda_benchmark.cc @@ -15,18 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include #include "arrow/array.h" +#include "arrow/gpu/cuda_api.h" #include "arrow/memory_pool.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" - -#include "arrow/gpu/cuda_api.h" +#include "benchmark/benchmark.h" namespace arrow { namespace cuda { diff --git a/cpp/src/arrow/gpu/cuda_context.cc b/cpp/src/arrow/gpu/cuda_context.cc index bb0b055e5d255..1b6eb57e77ab7 100644 --- a/cpp/src/arrow/gpu/cuda_context.cc +++ b/cpp/src/arrow/gpu/cuda_context.cc @@ -17,6 +17,8 @@ #include "arrow/gpu/cuda_context.h" +#include + #include #include #include @@ -26,8 +28,6 @@ #include #include -#include - #include "arrow/gpu/cuda_internal.h" #include "arrow/gpu/cuda_memory.h" #include "arrow/util/checked_cast.h" diff --git a/cpp/src/arrow/gpu/cuda_internal.h b/cpp/src/arrow/gpu/cuda_internal.h index 25eb6e06cee40..6574170c8bfa0 100644 --- a/cpp/src/arrow/gpu/cuda_internal.h +++ b/cpp/src/arrow/gpu/cuda_internal.h @@ -19,11 +19,11 @@ #pragma once +#include + #include #include -#include - #include "arrow/gpu/cuda_context.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/gpu/cuda_memory.cc b/cpp/src/arrow/gpu/cuda_memory.cc index 80304d44cfdb7..db28e91d7205f 100644 --- a/cpp/src/arrow/gpu/cuda_memory.cc +++ b/cpp/src/arrow/gpu/cuda_memory.cc @@ -17,6 +17,8 @@ #include "arrow/gpu/cuda_memory.h" +#include + #include #include #include @@ -24,17 +26,14 @@ #include #include -#include - #include "arrow/buffer.h" +#include "arrow/gpu/cuda_context.h" +#include "arrow/gpu/cuda_internal.h" #include "arrow/io/memory.h" #include "arrow/memory_pool.h" #include "arrow/status.h" #include "arrow/util/logging.h" -#include "arrow/gpu/cuda_context.h" -#include "arrow/gpu/cuda_internal.h" - namespace arrow { namespace cuda { diff --git a/cpp/src/arrow/gpu/cuda_test.cc b/cpp/src/arrow/gpu/cuda_test.cc index 08cf442848e66..c6bfd1749017e 100644 --- a/cpp/src/arrow/gpu/cuda_test.cc +++ b/cpp/src/arrow/gpu/cuda_test.cc @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include -#include - -#include "gtest/gtest.h" - +#include "arrow/gpu/cuda_api.h" +#include "arrow/gpu/cuda_internal.h" #include "arrow/io/memory.h" #include "arrow/ipc/api.h" #include "arrow/ipc/dictionary.h" @@ -30,11 +30,9 @@ #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" - -#include "arrow/gpu/cuda_api.h" -#include "arrow/gpu/cuda_internal.h" #include "arrow/util/checked_cast.h" #include "arrow/util/macros.h" +#include "gtest/gtest.h" namespace arrow { diff --git a/cpp/src/arrow/io/buffered_test.cc b/cpp/src/arrow/io/buffered_test.cc index 1fefc261b1d33..9a29c56382129 100644 --- a/cpp/src/arrow/io/buffered_test.cc +++ b/cpp/src/arrow/io/buffered_test.cc @@ -20,6 +20,8 @@ #include #endif +#include + #include #include #include @@ -32,8 +34,6 @@ #include #include -#include - #include "arrow/io/buffered.h" #include "arrow/io/file.h" #include "arrow/io/interfaces.h" diff --git a/cpp/src/arrow/io/caching.cc b/cpp/src/arrow/io/caching.cc index 1a7a55cd1b212..974a3556d5b8a 100644 --- a/cpp/src/arrow/io/caching.cc +++ b/cpp/src/arrow/io/caching.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/io/caching.h" + #include #include #include @@ -22,7 +24,6 @@ #include #include "arrow/buffer.h" -#include "arrow/io/caching.h" #include "arrow/io/util_internal.h" #include "arrow/result.h" #include "arrow/util/future.h" diff --git a/cpp/src/arrow/io/compressed_test.cc b/cpp/src/arrow/io/compressed_test.cc index 4da0a1bc1919b..1fcb49a531eba 100644 --- a/cpp/src/arrow/io/compressed_test.cc +++ b/cpp/src/arrow/io/compressed_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/io/compressed.h" + +#include + #include #include #include @@ -23,10 +27,7 @@ #include #include -#include - #include "arrow/buffer.h" -#include "arrow/io/compressed.h" #include "arrow/io/memory.h" #include "arrow/io/test_common.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/io/file.cc b/cpp/src/arrow/io/file.cc index 8a4976db4aa61..1d5cdca0c3118 100644 --- a/cpp/src/arrow/io/file.cc +++ b/cpp/src/arrow/io/file.cc @@ -45,11 +45,10 @@ // ---------------------------------------------------------------------- // Other Arrow includes +#include "arrow/buffer.h" #include "arrow/io/file.h" #include "arrow/io/interfaces.h" #include "arrow/io/util_internal.h" - -#include "arrow/buffer.h" #include "arrow/memory_pool.h" #include "arrow/status.h" #include "arrow/util/future.h" diff --git a/cpp/src/arrow/io/file_benchmark.cc b/cpp/src/arrow/io/file_benchmark.cc index 5e7e55725da78..9333047cbad91 100644 --- a/cpp/src/arrow/io/file_benchmark.cc +++ b/cpp/src/arrow/io/file_benchmark.cc @@ -15,22 +15,21 @@ // specific language governing permissions and limitations // under the License. +#include +#include +#include +#include +#include +#include + #include "arrow/io/buffered.h" #include "arrow/io/file.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" #include "arrow/util/logging.h" #include "arrow/util/windows_compatibility.h" - #include "benchmark/benchmark.h" -#include -#include -#include -#include -#include -#include - #ifdef _WIN32 #include diff --git a/cpp/src/arrow/io/file_test.cc b/cpp/src/arrow/io/file_test.cc index 7d3d1c621cec1..d09887974df31 100644 --- a/cpp/src/arrow/io/file_test.cc +++ b/cpp/src/arrow/io/file_test.cc @@ -20,6 +20,8 @@ #include #endif +#include + #include #include #include @@ -31,8 +33,6 @@ #include #include -#include - #include "arrow/buffer.h" #include "arrow/io/file.h" #include "arrow/io/interfaces.h" diff --git a/cpp/src/arrow/io/hdfs.cc b/cpp/src/arrow/io/hdfs.cc index e7e42f307004d..9dee04843c2a9 100644 --- a/cpp/src/arrow/io/hdfs.cc +++ b/cpp/src/arrow/io/hdfs.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/io/hdfs.h" + #include #include #include @@ -29,7 +31,6 @@ #include #include "arrow/buffer.h" -#include "arrow/io/hdfs.h" #include "arrow/io/hdfs_internal.h" #include "arrow/io/interfaces.h" #include "arrow/memory_pool.h" diff --git a/cpp/src/arrow/io/hdfs_internal.h b/cpp/src/arrow/io/hdfs_internal.h index 624938231dbfb..e3e0e0c7b9ab8 100644 --- a/cpp/src/arrow/io/hdfs_internal.h +++ b/cpp/src/arrow/io/hdfs_internal.h @@ -17,11 +17,11 @@ #pragma once +#include + #include #include -#include - #include "arrow/util/visibility.h" #include "arrow/util/windows_compatibility.h" // IWYU pragma: keep diff --git a/cpp/src/arrow/io/hdfs_test.cc b/cpp/src/arrow/io/hdfs_test.cc index 2ebf950808fc0..6066fc192b4ed 100644 --- a/cpp/src/arrow/io/hdfs_test.cc +++ b/cpp/src/arrow/io/hdfs_test.cc @@ -15,7 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/io/hdfs.h" + +#include + #include +#include // NOLINT #include #include #include @@ -26,12 +31,7 @@ #include #include -#include - -#include // NOLINT - #include "arrow/buffer.h" -#include "arrow/io/hdfs.h" #include "arrow/io/hdfs_internal.h" #include "arrow/io/interfaces.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/io/memory_benchmark.cc b/cpp/src/arrow/io/memory_benchmark.cc index fbb34f38654b6..06f823530b809 100644 --- a/cpp/src/arrow/io/memory_benchmark.cc +++ b/cpp/src/arrow/io/memory_benchmark.cc @@ -22,7 +22,6 @@ #include "arrow/testing/util.h" #include "arrow/util/cpu_info.h" #include "arrow/util/simd.h" - #include "benchmark/benchmark.h" namespace arrow { @@ -49,10 +48,10 @@ using VectorType = __m512i; #define VectorSet _mm512_set1_epi32 #define VectorLoad _mm512_stream_load_si512 #define VectorLoadAsm(SRC, DST) \ - asm volatile("vmovaps %[src], %[dst]" : [ dst ] "=v"(DST) : [ src ] "m"(SRC) :) + asm volatile("vmovaps %[src], %[dst]" : [dst] "=v"(DST) : [src] "m"(SRC) :) #define VectorStreamLoad _mm512_stream_load_si512 #define VectorStreamLoadAsm(SRC, DST) \ - asm volatile("vmovntdqa %[src], %[dst]" : [ dst ] "=v"(DST) : [ src ] "m"(SRC) :) + asm volatile("vmovntdqa %[src], %[dst]" : [dst] "=v"(DST) : [src] "m"(SRC) :) #define VectorStreamWrite _mm512_stream_si512 #else @@ -63,10 +62,10 @@ using VectorType = __m256i; #define VectorSet _mm256_set1_epi32 #define VectorLoad _mm256_stream_load_si256 #define VectorLoadAsm(SRC, DST) \ - asm volatile("vmovaps %[src], %[dst]" : [ dst ] "=v"(DST) : [ src ] "m"(SRC) :) + asm volatile("vmovaps %[src], %[dst]" : [dst] "=v"(DST) : [src] "m"(SRC) :) #define VectorStreamLoad _mm256_stream_load_si256 #define VectorStreamLoadAsm(SRC, DST) \ - asm volatile("vmovntdqa %[src], %[dst]" : [ dst ] "=v"(DST) : [ src ] "m"(SRC) :) + asm volatile("vmovntdqa %[src], %[dst]" : [dst] "=v"(DST) : [src] "m"(SRC) :) #define VectorStreamWrite _mm256_stream_si256 #else // ARROW_HAVE_AVX2 not set @@ -75,10 +74,10 @@ using VectorType = __m128i; #define VectorSet _mm_set1_epi32 #define VectorLoad _mm_stream_load_si128 #define VectorLoadAsm(SRC, DST) \ - asm volatile("movaps %[src], %[dst]" : [ dst ] "=x"(DST) : [ src ] "m"(SRC) :) + asm volatile("movaps %[src], %[dst]" : [dst] "=x"(DST) : [src] "m"(SRC) :) #define VectorStreamLoad _mm_stream_load_si128 #define VectorStreamLoadAsm(SRC, DST) \ - asm volatile("movntdqa %[src], %[dst]" : [ dst ] "=x"(DST) : [ src ] "m"(SRC) :) + asm volatile("movntdqa %[src], %[dst]" : [dst] "=x"(DST) : [src] "m"(SRC) :) #define VectorStreamWrite _mm_stream_si128 #endif // ARROW_HAVE_AVX2 @@ -164,14 +163,14 @@ using VectorTypeDual = uint8x16x2_t; static void armv8_stream_load_pair(VectorType* src, VectorType* dst) { asm volatile("LDNP %[reg1], %[reg2], [%[from]]\n\t" - : [ reg1 ] "+r"(*dst), [ reg2 ] "+r"(*(dst + 1)) - : [ from ] "r"(src)); + : [reg1] "+r"(*dst), [reg2] "+r"(*(dst + 1)) + : [from] "r"(src)); } static void armv8_stream_store_pair(VectorType* src, VectorType* dst) { asm volatile("STNP %[reg1], %[reg2], [%[to]]\n\t" - : [ to ] "+r"(dst) - : [ reg1 ] "r"(*src), [ reg2 ] "r"(*(src + 1)) + : [to] "+r"(dst) + : [reg1] "r"(*src), [reg2] "r"(*(src + 1)) : "memory"); } @@ -179,7 +178,7 @@ static void armv8_stream_ldst_pair(VectorType* src, VectorType* dst) { asm volatile( "LDNP q1, q2, [%[from]]\n\t" "STNP q1, q2, [%[to]]\n\t" - : [ from ] "+r"(src), [ to ] "+r"(dst) + : [from] "+r"(src), [to] "+r"(dst) : : "memory", "v0", "v1", "v2", "v3"); } diff --git a/cpp/src/arrow/io/memory_test.cc b/cpp/src/arrow/io/memory_test.cc index 00a1dcedb5585..fda9c67e52fe5 100644 --- a/cpp/src/arrow/io/memory_test.cc +++ b/cpp/src/arrow/io/memory_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/io/memory.h" + +#include + #include #include #include @@ -27,12 +31,9 @@ #include #include -#include - #include "arrow/buffer.h" #include "arrow/io/caching.h" #include "arrow/io/interfaces.h" -#include "arrow/io/memory.h" #include "arrow/io/slow.h" #include "arrow/io/transform.h" #include "arrow/io/util_internal.h" diff --git a/cpp/src/arrow/io/mman.h b/cpp/src/arrow/io/mman.h index 9b06ac8e7b5ca..fdfb7ff802f3d 100644 --- a/cpp/src/arrow/io/mman.h +++ b/cpp/src/arrow/io/mman.h @@ -7,14 +7,14 @@ #pragma once -#include "arrow/util/windows_compatibility.h" - #include #include #include #include +#include "arrow/util/windows_compatibility.h" + #define PROT_NONE 0 #define PROT_READ 1 #define PROT_WRITE 2 diff --git a/cpp/src/arrow/ipc/feather.cc b/cpp/src/arrow/ipc/feather.cc index 7561945d5f57e..353d798cee02c 100644 --- a/cpp/src/arrow/ipc/feather.cc +++ b/cpp/src/arrow/ipc/feather.cc @@ -17,6 +17,8 @@ #include "arrow/ipc/feather.h" +#include + #include #include #include @@ -27,8 +29,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/chunked_array.h" @@ -48,7 +48,6 @@ #include "arrow/util/logging.h" #include "arrow/util/make_unique.h" #include "arrow/visitor_inline.h" - #include "generated/feather_generated.h" namespace arrow { diff --git a/cpp/src/arrow/ipc/feather_test.cc b/cpp/src/arrow/ipc/feather_test.cc index e9a3c72c61af1..62a76bc59638c 100644 --- a/cpp/src/arrow/ipc/feather_test.cc +++ b/cpp/src/arrow/ipc/feather_test.cc @@ -15,18 +15,19 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/ipc/feather.h" + +#include + #include #include #include #include #include -#include - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/io/memory.h" -#include "arrow/ipc/feather.h" #include "arrow/ipc/test_common.h" #include "arrow/record_batch.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/ipc/file_to_stream.cc b/cpp/src/arrow/ipc/file_to_stream.cc index c15eb6de21f95..3f9f1777d53d5 100644 --- a/cpp/src/arrow/ipc/file_to_stream.cc +++ b/cpp/src/arrow/ipc/file_to_stream.cc @@ -24,7 +24,6 @@ #include "arrow/ipc/writer.h" #include "arrow/result.h" #include "arrow/status.h" - #include "arrow/util/io_util.h" namespace arrow { diff --git a/cpp/src/arrow/ipc/json_simple.cc b/cpp/src/arrow/ipc/json_simple.cc index caf6fd06b9c31..34575ab1c6e53 100644 --- a/cpp/src/arrow/ipc/json_simple.cc +++ b/cpp/src/arrow/ipc/json_simple.cc @@ -15,6 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/ipc/json_simple.h" + +#include +#include +#include +#include +#include + #include #include #include @@ -29,7 +37,7 @@ #include "arrow/array/builder_primitive.h" #include "arrow/array/builder_time.h" #include "arrow/array/builder_union.h" -#include "arrow/ipc/json_simple.h" +#include "arrow/json/rapidjson_defs.h" #include "arrow/type_traits.h" #include "arrow/util/checked_cast.h" #include "arrow/util/decimal.h" @@ -37,14 +45,6 @@ #include "arrow/util/string_view.h" #include "arrow/util/value_parsing.h" -#include "arrow/json/rapidjson_defs.h" - -#include -#include -#include -#include -#include - namespace rj = arrow::rapidjson; namespace arrow { diff --git a/cpp/src/arrow/ipc/json_simple_test.cc b/cpp/src/arrow/ipc/json_simple_test.cc index c5358ac89f186..4aa2ba4abe115 100644 --- a/cpp/src/arrow/ipc/json_simple_test.cc +++ b/cpp/src/arrow/ipc/json_simple_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/ipc/json_simple.h" + +#include + #include #include #include @@ -27,14 +31,11 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/array/builder_decimal.h" #include "arrow/array/builder_nested.h" #include "arrow/array/builder_primitive.h" #include "arrow/array/builder_time.h" -#include "arrow/ipc/json_simple.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/type_traits.h" diff --git a/cpp/src/arrow/ipc/message.cc b/cpp/src/arrow/ipc/message.cc index 6db8a0f0d3d23..f4f5b374b431f 100644 --- a/cpp/src/arrow/ipc/message.cc +++ b/cpp/src/arrow/ipc/message.cc @@ -35,7 +35,6 @@ #include "arrow/util/endian.h" #include "arrow/util/logging.h" #include "arrow/util/ubsan.h" - #include "generated/Message_generated.h" namespace arrow { diff --git a/cpp/src/arrow/ipc/metadata_internal.cc b/cpp/src/arrow/ipc/metadata_internal.cc index c16297314d9c5..820e9fc1c0814 100644 --- a/cpp/src/arrow/ipc/metadata_internal.cc +++ b/cpp/src/arrow/ipc/metadata_internal.cc @@ -17,14 +17,14 @@ #include "arrow/ipc/metadata_internal.h" +#include + #include #include #include #include #include -#include - #include "arrow/extension_type.h" #include "arrow/io/interfaces.h" #include "arrow/ipc/dictionary.h" @@ -40,7 +40,6 @@ #include "arrow/util/logging.h" #include "arrow/util/ubsan.h" #include "arrow/visitor_inline.h" - #include "generated/File_generated.h" #include "generated/Message_generated.h" #include "generated/Schema_generated.h" diff --git a/cpp/src/arrow/ipc/metadata_internal.h b/cpp/src/arrow/ipc/metadata_internal.h index 9cf489dd66884..71823174bbe82 100644 --- a/cpp/src/arrow/ipc/metadata_internal.h +++ b/cpp/src/arrow/ipc/metadata_internal.h @@ -19,6 +19,8 @@ #pragma once +#include + #include #include #include @@ -26,8 +28,6 @@ #include #include -#include - #include "arrow/buffer.h" #include "arrow/io/type_fwd.h" #include "arrow/ipc/message.h" @@ -37,7 +37,6 @@ #include "arrow/type_fwd.h" #include "arrow/util/macros.h" #include "arrow/util/visibility.h" - #include "generated/Message_generated.h" #include "generated/Schema_generated.h" #include "generated/SparseTensor_generated.h" // IWYU pragma: keep diff --git a/cpp/src/arrow/ipc/options.cc b/cpp/src/arrow/ipc/options.cc index e73332db7cedd..ea09708ac1829 100644 --- a/cpp/src/arrow/ipc/options.cc +++ b/cpp/src/arrow/ipc/options.cc @@ -29,7 +29,8 @@ IpcReadOptions IpcReadOptions::Defaults() { return IpcReadOptions(); } namespace internal { Status CheckCompressionSupported(Compression::type codec) { - if (!(codec == Compression::LZ4_FRAME || codec == Compression::ZSTD || codec == Compression::FASTPFOR)) { + if (!(codec == Compression::LZ4_FRAME || codec == Compression::ZSTD || + codec == Compression::FASTPFOR)) { return Status::Invalid("Only LZ4_FRAME and ZSTD compression allowed"); } return Status::OK(); diff --git a/cpp/src/arrow/ipc/read_write_benchmark.cc b/cpp/src/arrow/ipc/read_write_benchmark.cc index a56dd3579e229..79afdfe2dfca6 100644 --- a/cpp/src/arrow/ipc/read_write_benchmark.cc +++ b/cpp/src/arrow/ipc/read_write_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -27,6 +25,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/type.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/ipc/read_write_test.cc b/cpp/src/arrow/ipc/read_write_test.cc index 2d9a19b1b5d29..3a741b0b1b03e 100644 --- a/cpp/src/arrow/ipc/read_write_test.cc +++ b/cpp/src/arrow/ipc/read_write_test.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include @@ -23,9 +26,6 @@ #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_primitive.h" #include "arrow/io/file.h" @@ -48,7 +48,6 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/io_util.h" #include "arrow/util/key_value_metadata.h" - #include "generated/Message_generated.h" // IWYU pragma: keep namespace arrow { diff --git a/cpp/src/arrow/ipc/reader.cc b/cpp/src/arrow/ipc/reader.cc index 715c109c85fdd..d636b5f571376 100644 --- a/cpp/src/arrow/ipc/reader.cc +++ b/cpp/src/arrow/ipc/reader.cc @@ -17,6 +17,8 @@ #include "arrow/ipc/reader.h" +#include // IWYU pragma: export + #include #include #include @@ -26,8 +28,6 @@ #include #include -#include // IWYU pragma: export - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/extension_type.h" @@ -53,7 +53,6 @@ #include "arrow/util/string.h" #include "arrow/util/ubsan.h" #include "arrow/visitor_inline.h" - #include "generated/File_generated.h" // IWYU pragma: export #include "generated/Message_generated.h" #include "generated/Schema_generated.h" @@ -427,7 +426,7 @@ Result> DecompressBuffer(const std::shared_ptr& } Status DecompressBufferByType(const Buffer& buffer, util::Codec* codec, - std::shared_ptr* out, MemoryPool* pool) { + std::shared_ptr* out, MemoryPool* pool) { const uint8_t* data = buffer.data(); int64_t compressed_size = buffer.size() - sizeof(int64_t); int64_t uncompressed_size = BitUtil::FromLittleEndian(util::SafeLoadAs(data)); @@ -485,13 +484,13 @@ Status DecompressBuffersByType(Compression::type compression, case DataTypeLayout::BufferKind::FIXED_WIDTH: if (layout.byte_width == 4 && field->type()->id() != Type::FLOAT) { RETURN_NOT_OK(DecompressBufferByType(*buffer, fastpfor32_codec.get(), &buffer, - options.memory_pool)); + options.memory_pool)); } else if (layout.byte_width == 8 && field->type()->id() != Type::DOUBLE) { RETURN_NOT_OK(DecompressBufferByType(*buffer, fastpfor64_codec.get(), &buffer, - options.memory_pool)); + options.memory_pool)); } else { - RETURN_NOT_OK( - DecompressBufferByType(*buffer, codec.get(), &buffer, options.memory_pool)); + RETURN_NOT_OK(DecompressBufferByType(*buffer, codec.get(), &buffer, + options.memory_pool)); } break; case DataTypeLayout::BufferKind::BITMAP: @@ -591,12 +590,12 @@ Result> LoadRecordBatchSubset( filtered_columns = std::move(columns); } if (context.compression != Compression::UNCOMPRESSED) { - if (context.compression == Compression::FASTPFOR) { - RETURN_NOT_OK( - DecompressBuffersByType(context.compression, context.options, &filtered_columns, filtered_fields)); + RETURN_NOT_OK(DecompressBuffersByType(context.compression, context.options, + &filtered_columns, filtered_fields)); } else { - RETURN_NOT_OK(DecompressBuffers(context.compression, context.options, &filtered_columns)); + RETURN_NOT_OK( + DecompressBuffers(context.compression, context.options, &filtered_columns)); } } diff --git a/cpp/src/arrow/ipc/stream_to_file.cc b/cpp/src/arrow/ipc/stream_to_file.cc index 3a2a7fb49feb7..7eba2a2a8562a 100644 --- a/cpp/src/arrow/ipc/stream_to_file.cc +++ b/cpp/src/arrow/ipc/stream_to_file.cc @@ -23,7 +23,6 @@ #include "arrow/ipc/writer.h" #include "arrow/record_batch.h" #include "arrow/status.h" - #include "arrow/util/io_util.h" namespace arrow { diff --git a/cpp/src/arrow/ipc/tensor_test.cc b/cpp/src/arrow/ipc/tensor_test.cc index 7af1492f624a1..7485e9a6cfe17 100644 --- a/cpp/src/arrow/ipc/tensor_test.cc +++ b/cpp/src/arrow/ipc/tensor_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/tensor.h" + +#include + #include #include #include @@ -22,8 +26,6 @@ #include #include -#include - #include "arrow/io/file.h" #include "arrow/io/memory.h" #include "arrow/io/test_common.h" @@ -32,7 +34,6 @@ #include "arrow/ipc/writer.h" #include "arrow/sparse_tensor.h" #include "arrow/status.h" -#include "arrow/tensor.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/ipc/test_common.cc b/cpp/src/arrow/ipc/test_common.cc index ab10238850c97..5d32f9181415e 100644 --- a/cpp/src/arrow/ipc/test_common.cc +++ b/cpp/src/arrow/ipc/test_common.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/ipc/test_common.h" + #include #include #include @@ -28,7 +30,6 @@ #include "arrow/array/builder_binary.h" #include "arrow/array/builder_primitive.h" #include "arrow/array/builder_time.h" -#include "arrow/ipc/test_common.h" #include "arrow/pretty_print.h" #include "arrow/record_batch.h" #include "arrow/status.h" diff --git a/cpp/src/arrow/ipc/writer.cc b/cpp/src/arrow/ipc/writer.cc index 37e29f5c179c9..4f7a9b4ec02eb 100644 --- a/cpp/src/arrow/ipc/writer.cc +++ b/cpp/src/arrow/ipc/writer.cc @@ -218,17 +218,19 @@ class RecordBatchSerializer { std::unique_ptr codec; std::unique_ptr int32_codec; std::unique_ptr int64_codec; + ARROW_ASSIGN_OR_RAISE(codec, + util::Codec::Create(Compression::LZ4_FRAME, + arrow::util::kUseDefaultCompressionLevel)); ARROW_ASSIGN_OR_RAISE( - codec, util::Codec::Create(Compression::LZ4_FRAME, arrow::util::kUseDefaultCompressionLevel)); + int32_codec, util::Codec::CreateInt32(options_.codec->compression_type(), + arrow::util::kUseDefaultCompressionLevel)); ARROW_ASSIGN_OR_RAISE( - int32_codec, - util::Codec::CreateInt32(options_.codec->compression_type(), arrow::util::kUseDefaultCompressionLevel)); - ARROW_ASSIGN_OR_RAISE( - int64_codec, - util::Codec::CreateInt64(options_.codec->compression_type(), arrow::util::kUseDefaultCompressionLevel)); + int64_codec, util::Codec::CreateInt64(options_.codec->compression_type(), + arrow::util::kUseDefaultCompressionLevel)); - AppendCustomMetadata("ARROW:experimental_compression", - util::Codec::GetCodecAsString(options_.codec->compression_type())); + AppendCustomMetadata( + "ARROW:experimental_compression", + util::Codec::GetCodecAsString(options_.codec->compression_type())); int32_t buffer_idx = 0; for (const auto& field : fields) { @@ -283,7 +285,6 @@ class RecordBatchSerializer { } if (options_.codec != nullptr) { - if (options_.codec->compression_type() == Compression::FASTPFOR) { RETURN_NOT_OK(CompressBodyBuffersByType(batch.schema()->fields())); } else { diff --git a/cpp/src/arrow/jniutil/jni_util.cc b/cpp/src/arrow/jniutil/jni_util.cc index 8fd9c234c9a25..bdb4ed5412061 100644 --- a/cpp/src/arrow/jniutil/jni_util.cc +++ b/cpp/src/arrow/jniutil/jni_util.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/ipc/metadata_internal.h" #include "arrow/jniutil/jni_util.h" -#include "arrow/util/base64.h" -#include "arrow/util/key_value_metadata.h" -#include "arrow/util/logging.h" + +#include #include #include -#include +#include "arrow/ipc/metadata_internal.h" +#include "arrow/util/base64.h" +#include "arrow/util/key_value_metadata.h" +#include "arrow/util/logging.h" namespace arrow { namespace jniutil { diff --git a/cpp/src/arrow/jniutil/jni_util.h b/cpp/src/arrow/jniutil/jni_util.h index 5af84038a9a93..601c5052f589a 100644 --- a/cpp/src/arrow/jniutil/jni_util.h +++ b/cpp/src/arrow/jniutil/jni_util.h @@ -17,6 +17,8 @@ #pragma once +#include + #include "arrow/array.h" #include "arrow/io/api.h" #include "arrow/ipc/api.h" @@ -24,8 +26,6 @@ #include "arrow/result.h" #include "arrow/type.h" -#include - namespace arrow { namespace jniutil { diff --git a/cpp/src/arrow/jniutil/jni_util_test.cc b/cpp/src/arrow/jniutil/jni_util_test.cc index 893c28125c0c5..5858de9186a0c 100644 --- a/cpp/src/arrow/jniutil/jni_util_test.cc +++ b/cpp/src/arrow/jniutil/jni_util_test.cc @@ -15,11 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/jniutil/jni_util.h" + #include #include "arrow/memory_pool.h" #include "arrow/testing/gtest_util.h" -#include "arrow/jniutil/jni_util.h" namespace arrow { namespace jniutil { diff --git a/cpp/src/arrow/json/chunked_builder_test.cc b/cpp/src/arrow/json/chunked_builder_test.cc index a3810316f7604..8c3cf1cd8fda2 100644 --- a/cpp/src/arrow/json/chunked_builder_test.cc +++ b/cpp/src/arrow/json/chunked_builder_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/json/chunked_builder.h" + +#include + #include #include #include #include -#include - -#include "arrow/json/chunked_builder.h" #include "arrow/json/converter.h" #include "arrow/json/options.h" #include "arrow/json/test_common.h" diff --git a/cpp/src/arrow/json/chunker.cc b/cpp/src/arrow/json/chunker.cc index 568246bb63ba6..cb0dc7b4dc917 100644 --- a/cpp/src/arrow/json/chunker.cc +++ b/cpp/src/arrow/json/chunker.cc @@ -21,14 +21,13 @@ #include #include -#include "arrow/json/rapidjson_defs.h" -#include "rapidjson/reader.h" - #include "arrow/buffer.h" #include "arrow/json/options.h" +#include "arrow/json/rapidjson_defs.h" #include "arrow/util/logging.h" #include "arrow/util/make_unique.h" #include "arrow/util/string_view.h" +#include "rapidjson/reader.h" namespace arrow { diff --git a/cpp/src/arrow/json/chunker_test.cc b/cpp/src/arrow/json/chunker_test.cc index 1b4ea4d0824f9..2c0e4dd7e1cd9 100644 --- a/cpp/src/arrow/json/chunker_test.cc +++ b/cpp/src/arrow/json/chunker_test.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/json/chunker.h" + +#include + #include #include #include #include #include -#include - #include "arrow/buffer.h" -#include "arrow/json/chunker.h" #include "arrow/json/test_common.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/json/converter_test.cc b/cpp/src/arrow/json/converter_test.cc index 6d787db0bbdce..011d629a67e74 100644 --- a/cpp/src/arrow/json/converter_test.cc +++ b/cpp/src/arrow/json/converter_test.cc @@ -17,10 +17,10 @@ #include "arrow/json/converter.h" -#include - #include +#include + #include "arrow/json/options.h" #include "arrow/json/test_common.h" diff --git a/cpp/src/arrow/json/object_parser.cc b/cpp/src/arrow/json/object_parser.cc index c857cd537e7a5..8fe4bebf94df0 100644 --- a/cpp/src/arrow/json/object_parser.cc +++ b/cpp/src/arrow/json/object_parser.cc @@ -16,10 +16,11 @@ // under the License. #include "arrow/json/object_parser.h" -#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep #include +#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep + namespace arrow { namespace json { namespace internal { diff --git a/cpp/src/arrow/json/object_writer.cc b/cpp/src/arrow/json/object_writer.cc index 06d09f81e9440..f50cdb6769ff3 100644 --- a/cpp/src/arrow/json/object_writer.cc +++ b/cpp/src/arrow/json/object_writer.cc @@ -16,12 +16,13 @@ // under the License. #include "arrow/json/object_writer.h" -#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep #include #include #include +#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep + namespace rj = arrow::rapidjson; namespace arrow { diff --git a/cpp/src/arrow/json/parser.cc b/cpp/src/arrow/json/parser.cc index 05f155645a69d..fe3ff172dedd9 100644 --- a/cpp/src/arrow/json/parser.cc +++ b/cpp/src/arrow/json/parser.cc @@ -24,13 +24,10 @@ #include #include -#include "arrow/json/rapidjson_defs.h" -#include "rapidjson/error/en.h" -#include "rapidjson/reader.h" - #include "arrow/array.h" #include "arrow/array/builder_binary.h" #include "arrow/buffer_builder.h" +#include "arrow/json/rapidjson_defs.h" #include "arrow/type.h" #include "arrow/util/bitset_stack.h" #include "arrow/util/checked_cast.h" @@ -39,6 +36,8 @@ #include "arrow/util/string_view.h" #include "arrow/util/trie.h" #include "arrow/visitor_inline.h" +#include "rapidjson/error/en.h" +#include "rapidjson/reader.h" namespace arrow { diff --git a/cpp/src/arrow/json/parser_benchmark.cc b/cpp/src/arrow/json/parser_benchmark.cc index 9b7047d78a093..00198834beee9 100644 --- a/cpp/src/arrow/json/parser_benchmark.cc +++ b/cpp/src/arrow/json/parser_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include "arrow/json/chunker.h" @@ -26,6 +24,7 @@ #include "arrow/json/test_common.h" #include "arrow/table.h" #include "arrow/testing/gtest_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace json { diff --git a/cpp/src/arrow/json/reader_test.cc b/cpp/src/arrow/json/reader_test.cc index 976343b52118d..ea1ff03f95bdd 100644 --- a/cpp/src/arrow/json/reader_test.cc +++ b/cpp/src/arrow/json/reader_test.cc @@ -15,15 +15,16 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/json/reader.h" + +#include + #include #include #include -#include - #include "arrow/io/interfaces.h" #include "arrow/json/options.h" -#include "arrow/json/reader.h" #include "arrow/json/test_common.h" #include "arrow/table.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/json/test_common.h b/cpp/src/arrow/json/test_common.h index 618b16ae424b3..4e8154d545f40 100644 --- a/cpp/src/arrow/json/test_common.h +++ b/cpp/src/arrow/json/test_common.h @@ -24,21 +24,20 @@ #include #include -#include "arrow/json/rapidjson_defs.h" -#include "rapidjson/document.h" -#include "rapidjson/prettywriter.h" -#include "rapidjson/reader.h" -#include "rapidjson/writer.h" - #include "arrow/io/memory.h" #include "arrow/json/converter.h" #include "arrow/json/options.h" #include "arrow/json/parser.h" +#include "arrow/json/rapidjson_defs.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/util/string_view.h" #include "arrow/visitor_inline.h" +#include "rapidjson/document.h" +#include "rapidjson/prettywriter.h" +#include "rapidjson/reader.h" +#include "rapidjson/writer.h" namespace arrow { diff --git a/cpp/src/arrow/memory_pool_benchmark.cc b/cpp/src/arrow/memory_pool_benchmark.cc index ba39310a82ec0..be375d212e19c 100644 --- a/cpp/src/arrow/memory_pool_benchmark.cc +++ b/cpp/src/arrow/memory_pool_benchmark.cc @@ -18,7 +18,6 @@ #include "arrow/memory_pool.h" #include "arrow/result.h" #include "arrow/util/logging.h" - #include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/memory_pool_test.cc b/cpp/src/arrow/memory_pool_test.cc index 3ea35165f26ec..ad9694deca156 100644 --- a/cpp/src/arrow/memory_pool_test.cc +++ b/cpp/src/arrow/memory_pool_test.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "arrow/memory_pool.h" #include -#include "arrow/memory_pool.h" +#include +#include + #include "arrow/memory_pool_test.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/memory_pool_test.h b/cpp/src/arrow/memory_pool_test.h index f73f7a02807d4..fbb685b5dfacd 100644 --- a/cpp/src/arrow/memory_pool_test.h +++ b/cpp/src/arrow/memory_pool_test.h @@ -17,13 +17,13 @@ #pragma once +#include + #include #include #include #include -#include - #include "arrow/memory_pool.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/python/arrow_to_pandas.cc b/cpp/src/arrow/python/arrow_to_pandas.cc index f058e5261aea4..33b5b27bd2339 100644 --- a/cpp/src/arrow/python/arrow_to_pandas.cc +++ b/cpp/src/arrow/python/arrow_to_pandas.cc @@ -18,7 +18,6 @@ // Functions for pandas conversion via NumPy #include "arrow/python/arrow_to_pandas.h" -#include "arrow/python/numpy_interop.h" // IWYU pragma: expand #include #include @@ -32,7 +31,18 @@ #include "arrow/array.h" #include "arrow/buffer.h" +#include "arrow/compute/api.h" #include "arrow/datum.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_internal.h" +#include "arrow/python/numpy_interop.h" // IWYU pragma: expand +#include "arrow/python/pyarrow.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/type_traits.h" #include "arrow/status.h" #include "arrow/table.h" #include "arrow/type.h" @@ -46,18 +56,6 @@ #include "arrow/util/string_view.h" #include "arrow/visitor_inline.h" -#include "arrow/compute/api.h" - -#include "arrow/python/common.h" -#include "arrow/python/datetime.h" -#include "arrow/python/decimal.h" -#include "arrow/python/helpers.h" -#include "arrow/python/numpy_convert.h" -#include "arrow/python/numpy_internal.h" -#include "arrow/python/pyarrow.h" -#include "arrow/python/python_to_arrow.h" -#include "arrow/python/type_traits.h" - namespace arrow { class MemoryPool; diff --git a/cpp/src/arrow/python/arrow_to_pandas.h b/cpp/src/arrow/python/arrow_to_pandas.h index 6570364b8d2a1..eeba793c9c233 100644 --- a/cpp/src/arrow/python/arrow_to_pandas.h +++ b/cpp/src/arrow/python/arrow_to_pandas.h @@ -20,13 +20,12 @@ #pragma once -#include "arrow/python/platform.h" - #include #include #include #include "arrow/memory_pool.h" +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" namespace arrow { diff --git a/cpp/src/arrow/python/benchmark.h b/cpp/src/arrow/python/benchmark.h index 8060dd33722a0..dae053396f7d1 100644 --- a/cpp/src/arrow/python/benchmark.h +++ b/cpp/src/arrow/python/benchmark.h @@ -18,7 +18,6 @@ #pragma once #include "arrow/python/platform.h" - #include "arrow/python/visibility.h" namespace arrow { diff --git a/cpp/src/arrow/python/common.cc b/cpp/src/arrow/python/common.cc index 8ff348509e2f0..28348dd299838 100644 --- a/cpp/src/arrow/python/common.cc +++ b/cpp/src/arrow/python/common.cc @@ -22,12 +22,11 @@ #include #include "arrow/memory_pool.h" +#include "arrow/python/helpers.h" #include "arrow/status.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" -#include "arrow/python/helpers.h" - namespace arrow { using internal::checked_cast; diff --git a/cpp/src/arrow/python/decimal.cc b/cpp/src/arrow/python/decimal.cc index 67389095b946e..e1f3879899b6a 100644 --- a/cpp/src/arrow/python/decimal.cc +++ b/cpp/src/arrow/python/decimal.cc @@ -15,11 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/python/decimal.h" + #include #include #include "arrow/python/common.h" -#include "arrow/python/decimal.h" #include "arrow/python/helpers.h" #include "arrow/type_fwd.h" #include "arrow/util/decimal.h" diff --git a/cpp/src/arrow/python/deserialize.cc b/cpp/src/arrow/python/deserialize.cc index 961a1686e0a89..dfc586da27c94 100644 --- a/cpp/src/arrow/python/deserialize.cc +++ b/cpp/src/arrow/python/deserialize.cc @@ -17,7 +17,8 @@ #include "arrow/python/deserialize.h" -#include "arrow/python/numpy_interop.h" +#include +#include #include #include @@ -25,9 +26,6 @@ #include #include -#include -#include - #include "arrow/array.h" #include "arrow/io/interfaces.h" #include "arrow/io/memory.h" @@ -35,17 +33,17 @@ #include "arrow/ipc/reader.h" #include "arrow/ipc/util.h" #include "arrow/ipc/writer.h" -#include "arrow/table.h" -#include "arrow/util/checked_cast.h" -#include "arrow/util/logging.h" -#include "arrow/util/value_parsing.h" - #include "arrow/python/common.h" #include "arrow/python/datetime.h" #include "arrow/python/helpers.h" #include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_interop.h" #include "arrow/python/pyarrow.h" #include "arrow/python/serialize.h" +#include "arrow/table.h" +#include "arrow/util/checked_cast.h" +#include "arrow/util/logging.h" +#include "arrow/util/value_parsing.h" namespace arrow { diff --git a/cpp/src/arrow/python/extension_type.cc b/cpp/src/arrow/python/extension_type.cc index 3ccc171c8713a..c1ff578d68bb2 100644 --- a/cpp/src/arrow/python/extension_type.cc +++ b/cpp/src/arrow/python/extension_type.cc @@ -15,11 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/python/extension_type.h" + #include #include #include -#include "arrow/python/extension_type.h" #include "arrow/python/helpers.h" #include "arrow/python/pyarrow.h" #include "arrow/util/checked_cast.h" diff --git a/cpp/src/arrow/python/filesystem.cc b/cpp/src/arrow/python/filesystem.cc index 8e8e8a6e89955..609cfe5892040 100644 --- a/cpp/src/arrow/python/filesystem.cc +++ b/cpp/src/arrow/python/filesystem.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/python/filesystem.h" + #include "arrow/util/logging.h" namespace arrow { diff --git a/cpp/src/arrow/python/flight.cc b/cpp/src/arrow/python/flight.cc index ee1491e0d1491..6f8a6caf3fa6d 100644 --- a/cpp/src/arrow/python/flight.cc +++ b/cpp/src/arrow/python/flight.cc @@ -15,11 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/python/flight.h" + #include + #include #include "arrow/flight/internal.h" -#include "arrow/python/flight.h" #include "arrow/util/io_util.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/python/helpers.cc b/cpp/src/arrow/python/helpers.cc index 75a77c640bbc4..916f2ec236625 100644 --- a/cpp/src/arrow/python/helpers.cc +++ b/cpp/src/arrow/python/helpers.cc @@ -16,8 +16,6 @@ // under the License. // helpers.h includes a NumPy header, so we include this first -#include "arrow/python/numpy_interop.h" - #include "arrow/python/helpers.h" #include @@ -27,6 +25,7 @@ #include "arrow/python/common.h" #include "arrow/python/decimal.h" +#include "arrow/python/numpy_interop.h" #include "arrow/type_fwd.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/python/helpers.h b/cpp/src/arrow/python/helpers.h index 19288756c0ed6..2c3253e7f6926 100644 --- a/cpp/src/arrow/python/helpers.h +++ b/cpp/src/arrow/python/helpers.h @@ -17,7 +17,7 @@ #pragma once -#include "arrow/python/platform.h" +#include #include #include @@ -25,9 +25,7 @@ #include #include "arrow/python/numpy_interop.h" - -#include - +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/python/inference.cc b/cpp/src/arrow/python/inference.cc index 9d6707aa11d73..5875cbf88056e 100644 --- a/cpp/src/arrow/python/inference.cc +++ b/cpp/src/arrow/python/inference.cc @@ -16,7 +16,6 @@ // under the License. #include "arrow/python/inference.h" -#include "arrow/python/numpy_interop.h" #include @@ -27,15 +26,15 @@ #include #include -#include "arrow/status.h" -#include "arrow/util/decimal.h" -#include "arrow/util/logging.h" - #include "arrow/python/datetime.h" #include "arrow/python/decimal.h" #include "arrow/python/helpers.h" #include "arrow/python/iterators.h" #include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_interop.h" +#include "arrow/status.h" +#include "arrow/util/decimal.h" +#include "arrow/util/logging.h" namespace arrow { namespace py { diff --git a/cpp/src/arrow/python/inference.h b/cpp/src/arrow/python/inference.h index eff1836293430..845a4668d8929 100644 --- a/cpp/src/arrow/python/inference.h +++ b/cpp/src/arrow/python/inference.h @@ -20,16 +20,14 @@ #pragma once -#include "arrow/python/platform.h" - #include +#include "arrow/python/common.h" +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" -#include "arrow/python/common.h" - namespace arrow { class Array; diff --git a/cpp/src/arrow/python/init.cc b/cpp/src/arrow/python/init.cc index dba293bbe2366..3af3c9b825538 100644 --- a/cpp/src/arrow/python/init.cc +++ b/cpp/src/arrow/python/init.cc @@ -19,6 +19,7 @@ #define NUMPY_IMPORT_ARRAY #include "arrow/python/init.h" + #include "arrow/python/numpy_interop.h" int arrow_init_numpy() { return arrow::py::import_numpy(); } diff --git a/cpp/src/arrow/python/io.cc b/cpp/src/arrow/python/io.cc index 73525feed3848..f9405857823e2 100644 --- a/cpp/src/arrow/python/io.cc +++ b/cpp/src/arrow/python/io.cc @@ -25,11 +25,10 @@ #include "arrow/io/memory.h" #include "arrow/memory_pool.h" -#include "arrow/status.h" -#include "arrow/util/logging.h" - #include "arrow/python/common.h" #include "arrow/python/pyarrow.h" +#include "arrow/status.h" +#include "arrow/util/logging.h" namespace arrow { diff --git a/cpp/src/arrow/python/io.h b/cpp/src/arrow/python/io.h index a38d0ca332c97..50994590140da 100644 --- a/cpp/src/arrow/python/io.h +++ b/cpp/src/arrow/python/io.h @@ -21,7 +21,6 @@ #include "arrow/io/interfaces.h" #include "arrow/io/transform.h" - #include "arrow/python/common.h" #include "arrow/python/visibility.h" diff --git a/cpp/src/arrow/python/numpy_convert.cc b/cpp/src/arrow/python/numpy_convert.cc index 11ce0e50309ef..59d0a4c182d9f 100644 --- a/cpp/src/arrow/python/numpy_convert.cc +++ b/cpp/src/arrow/python/numpy_convert.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/python/numpy_interop.h" - #include "arrow/python/numpy_convert.h" #include @@ -25,15 +23,15 @@ #include #include "arrow/buffer.h" +#include "arrow/python/common.h" +#include "arrow/python/numpy_interop.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/type_traits.h" #include "arrow/sparse_tensor.h" #include "arrow/tensor.h" #include "arrow/type.h" #include "arrow/util/logging.h" -#include "arrow/python/common.h" -#include "arrow/python/pyarrow.h" -#include "arrow/python/type_traits.h" - namespace arrow { namespace py { diff --git a/cpp/src/arrow/python/numpy_convert.h b/cpp/src/arrow/python/numpy_convert.h index 10451077a221d..703cf06abd84c 100644 --- a/cpp/src/arrow/python/numpy_convert.h +++ b/cpp/src/arrow/python/numpy_convert.h @@ -20,13 +20,12 @@ #pragma once -#include "arrow/python/platform.h" - #include #include #include #include "arrow/buffer.h" +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" #include "arrow/sparse_tensor.h" diff --git a/cpp/src/arrow/python/numpy_internal.h b/cpp/src/arrow/python/numpy_internal.h index f43599eb3eb2f..1f4bfdb628174 100644 --- a/cpp/src/arrow/python/numpy_internal.h +++ b/cpp/src/arrow/python/numpy_internal.h @@ -19,16 +19,14 @@ #pragma once -#include "arrow/python/numpy_interop.h" - -#include "arrow/status.h" - -#include "arrow/python/platform.h" - #include #include #include +#include "arrow/python/numpy_interop.h" +#include "arrow/python/platform.h" +#include "arrow/status.h" + namespace arrow { namespace py { diff --git a/cpp/src/arrow/python/numpy_interop.h b/cpp/src/arrow/python/numpy_interop.h index ce7baed259f91..a90996db92bf8 100644 --- a/cpp/src/arrow/python/numpy_interop.h +++ b/cpp/src/arrow/python/numpy_interop.h @@ -17,10 +17,10 @@ #pragma once -#include "arrow/python/platform.h" // IWYU pragma: export - #include // IWYU pragma: export +#include "arrow/python/platform.h" // IWYU pragma: export + // Don't use the deprecated Numpy functions #ifdef NPY_1_7_API_VERSION #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION diff --git a/cpp/src/arrow/python/numpy_to_arrow.cc b/cpp/src/arrow/python/numpy_to_arrow.cc index c17e70823d561..07fefd598e9ad 100644 --- a/cpp/src/arrow/python/numpy_to_arrow.cc +++ b/cpp/src/arrow/python/numpy_to_arrow.cc @@ -18,7 +18,6 @@ // Functions for pandas conversion via NumPy #include "arrow/python/numpy_to_arrow.h" -#include "arrow/python/numpy_interop.h" #include #include @@ -32,6 +31,16 @@ #include "arrow/array.h" #include "arrow/array/builder_binary.h" +#include "arrow/compute/api_scalar.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/helpers.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_internal.h" +#include "arrow/python/numpy_interop.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/type_traits.h" #include "arrow/status.h" #include "arrow/table.h" #include "arrow/type_fwd.h" @@ -46,17 +55,6 @@ #include "arrow/util/utf8.h" #include "arrow/visitor_inline.h" -#include "arrow/compute/api_scalar.h" - -#include "arrow/python/common.h" -#include "arrow/python/datetime.h" -#include "arrow/python/helpers.h" -#include "arrow/python/iterators.h" -#include "arrow/python/numpy_convert.h" -#include "arrow/python/numpy_internal.h" -#include "arrow/python/python_to_arrow.h" -#include "arrow/python/type_traits.h" - namespace arrow { using internal::checked_cast; diff --git a/cpp/src/arrow/python/numpy_to_arrow.h b/cpp/src/arrow/python/numpy_to_arrow.h index b6cd093e55420..880d1f7db4ea6 100644 --- a/cpp/src/arrow/python/numpy_to_arrow.h +++ b/cpp/src/arrow/python/numpy_to_arrow.h @@ -19,11 +19,10 @@ #pragma once -#include "arrow/python/platform.h" - #include #include "arrow/compute/api.h" +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" namespace arrow { diff --git a/cpp/src/arrow/python/pyarrow.cc b/cpp/src/arrow/python/pyarrow.cc index bea35ff3b61f0..ee6e9df4b9e5b 100644 --- a/cpp/src/arrow/python/pyarrow.cc +++ b/cpp/src/arrow/python/pyarrow.cc @@ -21,12 +21,11 @@ #include #include "arrow/array.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" #include "arrow/table.h" #include "arrow/tensor.h" #include "arrow/type.h" - -#include "arrow/python/common.h" -#include "arrow/python/datetime.h" namespace { #include "arrow/python/pyarrow_api.h" } diff --git a/cpp/src/arrow/python/pyarrow.h b/cpp/src/arrow/python/pyarrow.h index 8056e700a0c2a..0ebe1c2f645fa 100644 --- a/cpp/src/arrow/python/pyarrow.h +++ b/cpp/src/arrow/python/pyarrow.h @@ -17,12 +17,10 @@ #pragma once -#include "arrow/python/platform.h" - #include +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" - #include "arrow/sparse_tensor.h" // Work around ARROW-2317 (C linkage warning from Cython) diff --git a/cpp/src/arrow/python/python_test.cc b/cpp/src/arrow/python/python_test.cc index 19eb86a09c6d0..d6a52a25dac25 100644 --- a/cpp/src/arrow/python/python_test.cc +++ b/cpp/src/arrow/python/python_test.cc @@ -15,29 +15,26 @@ // specific language governing permissions and limitations // under the License. -#include "gtest/gtest.h" - #include #include #include -#include "arrow/python/platform.h" - #include "arrow/array.h" #include "arrow/array/builder_binary.h" -#include "arrow/table.h" -#include "arrow/testing/gtest_util.h" -#include "arrow/util/decimal.h" -#include "arrow/util/optional.h" - #include "arrow/python/arrow_to_pandas.h" #include "arrow/python/decimal.h" #include "arrow/python/helpers.h" #include "arrow/python/numpy_convert.h" #include "arrow/python/numpy_interop.h" +#include "arrow/python/platform.h" #include "arrow/python/python_to_arrow.h" +#include "arrow/table.h" +#include "arrow/testing/gtest_util.h" #include "arrow/util/checked_cast.h" +#include "arrow/util/decimal.h" #include "arrow/util/logging.h" +#include "arrow/util/optional.h" +#include "gtest/gtest.h" namespace arrow { diff --git a/cpp/src/arrow/python/python_to_arrow.cc b/cpp/src/arrow/python/python_to_arrow.cc index b2d9f1cb5a3d9..9a3fde13876da 100644 --- a/cpp/src/arrow/python/python_to_arrow.cc +++ b/cpp/src/arrow/python/python_to_arrow.cc @@ -16,7 +16,6 @@ // under the License. #include "arrow/python/python_to_arrow.h" -#include "arrow/python/numpy_interop.h" #include @@ -34,6 +33,14 @@ #include "arrow/array/builder_nested.h" #include "arrow/array/builder_primitive.h" #include "arrow/chunked_array.h" +#include "arrow/python/datetime.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/inference.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_interop.h" +#include "arrow/python/type_traits.h" #include "arrow/status.h" #include "arrow/type.h" #include "arrow/type_traits.h" @@ -42,14 +49,6 @@ #include "arrow/util/decimal.h" #include "arrow/util/int_util_internal.h" #include "arrow/util/logging.h" - -#include "arrow/python/datetime.h" -#include "arrow/python/decimal.h" -#include "arrow/python/helpers.h" -#include "arrow/python/inference.h" -#include "arrow/python/iterators.h" -#include "arrow/python/numpy_convert.h" -#include "arrow/python/type_traits.h" #include "arrow/visitor_inline.h" namespace arrow { diff --git a/cpp/src/arrow/python/python_to_arrow.h b/cpp/src/arrow/python/python_to_arrow.h index d167996ba8da6..273bc8f009451 100644 --- a/cpp/src/arrow/python/python_to_arrow.h +++ b/cpp/src/arrow/python/python_to_arrow.h @@ -20,17 +20,15 @@ #pragma once -#include "arrow/python/platform.h" - #include #include +#include "arrow/python/common.h" +#include "arrow/python/platform.h" #include "arrow/python/visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" -#include "arrow/python/common.h" - namespace arrow { class Array; diff --git a/cpp/src/arrow/python/serialize.cc b/cpp/src/arrow/python/serialize.cc index ad079cbd9c704..261830667ae0b 100644 --- a/cpp/src/arrow/python/serialize.cc +++ b/cpp/src/arrow/python/serialize.cc @@ -16,7 +16,9 @@ // under the License. #include "arrow/python/serialize.h" -#include "arrow/python/numpy_interop.h" + +#include +#include #include #include @@ -25,9 +27,6 @@ #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_binary.h" #include "arrow/array/builder_nested.h" @@ -37,18 +36,18 @@ #include "arrow/io/memory.h" #include "arrow/ipc/util.h" #include "arrow/ipc/writer.h" -#include "arrow/record_batch.h" -#include "arrow/result.h" -#include "arrow/tensor.h" -#include "arrow/util/logging.h" - #include "arrow/python/common.h" #include "arrow/python/datetime.h" #include "arrow/python/helpers.h" #include "arrow/python/iterators.h" #include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_interop.h" #include "arrow/python/platform.h" #include "arrow/python/pyarrow.h" +#include "arrow/record_batch.h" +#include "arrow/result.h" +#include "arrow/tensor.h" +#include "arrow/util/logging.h" constexpr int32_t kMaxRecursionDepth = 100; diff --git a/cpp/src/arrow/python/type_traits.h b/cpp/src/arrow/python/type_traits.h index a941577f76558..8dfbb96e70fba 100644 --- a/cpp/src/arrow/python/type_traits.h +++ b/cpp/src/arrow/python/type_traits.h @@ -19,15 +19,13 @@ #pragma once -#include "arrow/python/platform.h" +#include #include #include #include "arrow/python/numpy_interop.h" - -#include - +#include "arrow/python/platform.h" #include "arrow/type_fwd.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/python/util/test_main.cc b/cpp/src/arrow/python/util/test_main.cc index dd7f379bdd4cc..fadde9f3b7e79 100644 --- a/cpp/src/arrow/python/util/test_main.cc +++ b/cpp/src/arrow/python/util/test_main.cc @@ -15,12 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/python/platform.h" - #include #include "arrow/python/datetime.h" #include "arrow/python/init.h" +#include "arrow/python/platform.h" #include "arrow/python/pyarrow.h" int main(int argc, char** argv) { diff --git a/cpp/src/arrow/result_test.cc b/cpp/src/arrow/result_test.cc index b71af9d8531a7..458ce0e573fd9 100644 --- a/cpp/src/arrow/result_test.cc +++ b/cpp/src/arrow/result_test.cc @@ -17,14 +17,14 @@ #include "arrow/result.h" +#include +#include + #include #include #include #include -#include -#include - #include "arrow/testing/gtest_compat.h" namespace arrow { diff --git a/cpp/src/arrow/scalar_test.cc b/cpp/src/arrow/scalar_test.cc index d99debb2ba945..4ebae20b5842e 100644 --- a/cpp/src/arrow/scalar_test.cc +++ b/cpp/src/arrow/scalar_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/scalar.h" + +#include + #include #include #include @@ -23,11 +27,8 @@ #include #include -#include - #include "arrow/buffer.h" #include "arrow/memory_pool.h" -#include "arrow/scalar.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/type_traits.h" diff --git a/cpp/src/arrow/sparse_tensor.cc b/cpp/src/arrow/sparse_tensor.cc index 03d59c3d79311..1dfc151549c49 100644 --- a/cpp/src/arrow/sparse_tensor.cc +++ b/cpp/src/arrow/sparse_tensor.cc @@ -16,7 +16,6 @@ // under the License. #include "arrow/sparse_tensor.h" -#include "arrow/tensor/converter.h" #include #include @@ -24,6 +23,7 @@ #include #include "arrow/compare.h" +#include "arrow/tensor/converter.h" #include "arrow/type_traits.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/sparse_tensor_test.cc b/cpp/src/arrow/sparse_tensor_test.cc index 219cdd9347277..902f688b59dc3 100644 --- a/cpp/src/arrow/sparse_tensor_test.cc +++ b/cpp/src/arrow/sparse_tensor_test.cc @@ -17,17 +17,17 @@ // Unit tests for DataType (and subclasses), Field, and Schema +#include "arrow/sparse_tensor.h" + +#include + #include #include +#include #include #include #include -#include - -#include - -#include "arrow/sparse_tensor.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/status_test.cc b/cpp/src/arrow/status_test.cc index fc5a7ec45cf38..0027ca90ae9ae 100644 --- a/cpp/src/arrow/status_test.cc +++ b/cpp/src/arrow/status_test.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include +#include "arrow/status.h" #include -#include "arrow/status.h" +#include namespace arrow { diff --git a/cpp/src/arrow/stl_iterator_test.cc b/cpp/src/arrow/stl_iterator_test.cc index 864011dbfc2be..1255549d6f608 100644 --- a/cpp/src/arrow/stl_iterator_test.cc +++ b/cpp/src/arrow/stl_iterator_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "arrow/stl_iterator.h" #include +#include +#include + #include "arrow/stl.h" -#include "arrow/stl_iterator.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" diff --git a/cpp/src/arrow/stl_test.cc b/cpp/src/arrow/stl_test.cc index 159d1d98312c1..e266a3f13efaa 100644 --- a/cpp/src/arrow/stl_test.cc +++ b/cpp/src/arrow/stl_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/stl.h" + +#include + #include #include #include @@ -23,10 +27,7 @@ #include #include -#include - #include "arrow/memory_pool.h" -#include "arrow/stl.h" #include "arrow/stl_allocator.h" #include "arrow/table.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/table_builder_test.cc b/cpp/src/arrow/table_builder_test.cc index c730913122ab6..ef68fd8de5f1e 100644 --- a/cpp/src/arrow/table_builder_test.cc +++ b/cpp/src/arrow/table_builder_test.cc @@ -15,14 +15,16 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/table_builder.h" + +#include + #include #include #include #include #include -#include - #include "arrow/array/array_base.h" #include "arrow/array/builder_binary.h" #include "arrow/array/builder_dict.h" @@ -30,7 +32,6 @@ #include "arrow/array/builder_primitive.h" #include "arrow/record_batch.h" #include "arrow/status.h" -#include "arrow/table_builder.h" #include "arrow/testing/gtest_common.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/table_test.cc b/cpp/src/arrow/table_test.cc index 88f7396254b6a..55b0af2755222 100644 --- a/cpp/src/arrow/table_test.cc +++ b/cpp/src/arrow/table_test.cc @@ -15,20 +15,21 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "arrow/table.h" #include #include +#include +#include +#include + #include "arrow/array/array_base.h" #include "arrow/array/data.h" #include "arrow/array/util.h" #include "arrow/chunked_array.h" #include "arrow/record_batch.h" #include "arrow/status.h" -#include "arrow/table.h" #include "arrow/testing/gtest_common.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/tensor/converter.h b/cpp/src/arrow/tensor/converter.h index 408ab22305fff..2d126d2da6e95 100644 --- a/cpp/src/arrow/tensor/converter.h +++ b/cpp/src/arrow/tensor/converter.h @@ -17,10 +17,10 @@ #pragma once -#include "arrow/sparse_tensor.h" // IWYU pragma: export - #include +#include "arrow/sparse_tensor.h" // IWYU pragma: export + namespace arrow { namespace internal { diff --git a/cpp/src/arrow/tensor/coo_converter.cc b/cpp/src/arrow/tensor/coo_converter.cc index 2124d0a4e4b79..68be2d2617dec 100644 --- a/cpp/src/arrow/tensor/coo_converter.cc +++ b/cpp/src/arrow/tensor/coo_converter.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/tensor/converter_internal.h" - #include #include #include @@ -25,6 +23,7 @@ #include "arrow/buffer.h" #include "arrow/status.h" +#include "arrow/tensor/converter_internal.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/tensor/csf_converter.cc b/cpp/src/arrow/tensor/csf_converter.cc index 77a71d8a12e4b..4fe17fb17daeb 100644 --- a/cpp/src/arrow/tensor/csf_converter.cc +++ b/cpp/src/arrow/tensor/csf_converter.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/tensor/converter.h" - #include #include #include @@ -27,6 +25,7 @@ #include "arrow/buffer_builder.h" #include "arrow/result.h" #include "arrow/status.h" +#include "arrow/tensor/converter.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/util/sort.h" diff --git a/cpp/src/arrow/tensor/csx_converter.cc b/cpp/src/arrow/tensor/csx_converter.cc index 137b5d3202f22..2561bc3810ddb 100644 --- a/cpp/src/arrow/tensor/csx_converter.cc +++ b/cpp/src/arrow/tensor/csx_converter.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/tensor/converter.h" - #include #include #include @@ -24,6 +22,7 @@ #include "arrow/buffer.h" #include "arrow/status.h" +#include "arrow/tensor/converter.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/visitor_inline.h" diff --git a/cpp/src/arrow/tensor/tensor_conversion_benchmark.cc b/cpp/src/arrow/tensor/tensor_conversion_benchmark.cc index 8456b2c4e29ce..6a732470f8e65 100644 --- a/cpp/src/arrow/tensor/tensor_conversion_benchmark.cc +++ b/cpp/src/arrow/tensor/tensor_conversion_benchmark.cc @@ -15,12 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" +#include #include "arrow/sparse_tensor.h" #include "arrow/testing/gtest_util.h" - -#include +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/tensor_test.cc b/cpp/src/arrow/tensor_test.cc index efb1b8d9232b7..0625d7ff268cd 100644 --- a/cpp/src/arrow/tensor_test.cc +++ b/cpp/src/arrow/tensor_test.cc @@ -17,6 +17,11 @@ // Unit tests for DataType (and subclasses), Field, and Schema +#include "arrow/tensor.h" + +#include +#include + #include #include #include @@ -24,11 +29,7 @@ #include #include -#include -#include - #include "arrow/buffer.h" -#include "arrow/tensor.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/testing/generator.cc b/cpp/src/arrow/testing/generator.cc index 71fad394d0014..1f39e0e744d3d 100644 --- a/cpp/src/arrow/testing/generator.cc +++ b/cpp/src/arrow/testing/generator.cc @@ -17,13 +17,13 @@ #include "arrow/testing/generator.h" +#include + #include #include #include #include -#include - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/testing/gtest_util.h" diff --git a/cpp/src/arrow/testing/gtest_common.h b/cpp/src/arrow/testing/gtest_common.h index 8b48238ed8a81..89999d8373a4e 100644 --- a/cpp/src/arrow/testing/gtest_common.h +++ b/cpp/src/arrow/testing/gtest_common.h @@ -17,6 +17,8 @@ #pragma once +#include + #include #include #include @@ -24,8 +26,6 @@ #include #include -#include - #include "arrow/array.h" #include "arrow/array/builder_binary.h" #include "arrow/array/builder_primitive.h" diff --git a/cpp/src/arrow/testing/gtest_util.cc b/cpp/src/arrow/testing/gtest_util.cc index 67343b0d86a50..83e306ea6e11b 100644 --- a/cpp/src/arrow/testing/gtest_util.cc +++ b/cpp/src/arrow/testing/gtest_util.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/testing/gtest_util.h" + #include "arrow/testing/extension_type.h" #ifndef _WIN32 diff --git a/cpp/src/arrow/testing/gtest_util.h b/cpp/src/arrow/testing/gtest_util.h index 0f25ac077679d..a504955638291 100644 --- a/cpp/src/arrow/testing/gtest_util.h +++ b/cpp/src/arrow/testing/gtest_util.h @@ -17,6 +17,8 @@ #pragma once +#include + #include #include #include @@ -28,8 +30,6 @@ #include #include -#include - #include "arrow/array/builder_binary.h" #include "arrow/array/builder_primitive.h" #include "arrow/result.h" diff --git a/cpp/src/arrow/testing/json_integration.cc b/cpp/src/arrow/testing/json_integration.cc index 2af094a781b56..6daa38efb03ce 100644 --- a/cpp/src/arrow/testing/json_integration.cc +++ b/cpp/src/arrow/testing/json_integration.cc @@ -17,6 +17,10 @@ #include "arrow/testing/json_integration.h" +#include +#include +#include + #include #include #include @@ -33,10 +37,6 @@ #include "arrow/type.h" #include "arrow/util/logging.h" -#include -#include -#include - using std::size_t; namespace arrow { diff --git a/cpp/src/arrow/testing/json_integration_test.cc b/cpp/src/arrow/testing/json_integration_test.cc index 34b871c56c1ab..6584f32604005 100644 --- a/cpp/src/arrow/testing/json_integration_test.cc +++ b/cpp/src/arrow/testing/json_integration_test.cc @@ -15,6 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/testing/json_integration.h" + +#include +#include + #include #include #include @@ -25,9 +30,6 @@ #include #include -#include -#include - #include "arrow/array.h" #include "arrow/array/builder_binary.h" #include "arrow/array/builder_primitive.h" @@ -40,7 +42,6 @@ #include "arrow/status.h" #include "arrow/testing/extension_type.h" #include "arrow/testing/gtest_util.h" -#include "arrow/testing/json_integration.h" #include "arrow/testing/json_internal.h" #include "arrow/testing/random.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/testing/json_internal.h b/cpp/src/arrow/testing/json_internal.h index 0870dd1e797d9..5f49f383dad79 100644 --- a/cpp/src/arrow/testing/json_internal.h +++ b/cpp/src/arrow/testing/json_internal.h @@ -17,12 +17,6 @@ #pragma once -#include -#include -#include - -#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep - #include // IWYU pragma: export #include // IWYU pragma: export #include // IWYU pragma: export @@ -30,7 +24,12 @@ #include // IWYU pragma: export #include // IWYU pragma: export -#include "arrow/status.h" // IWYU pragma: export +#include +#include +#include + +#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep +#include "arrow/status.h" // IWYU pragma: export #include "arrow/testing/visibility.h" #include "arrow/type_fwd.h" // IWYU pragma: keep diff --git a/cpp/src/arrow/testing/random_test.cc b/cpp/src/arrow/testing/random_test.cc index c1e5a83a31a9c..7ac23b3d28c8e 100644 --- a/cpp/src/arrow/testing/random_test.cc +++ b/cpp/src/arrow/testing/random_test.cc @@ -14,12 +14,13 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. +#include "arrow/testing/random.h" + #include #include "arrow/array.h" #include "arrow/record_batch.h" #include "arrow/testing/gtest_util.h" -#include "arrow/testing/random.h" #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/util/key_value_metadata.h" diff --git a/cpp/src/arrow/type_benchmark.cc b/cpp/src/arrow/type_benchmark.cc index de90577ffdf64..97df9919619d4 100644 --- a/cpp/src/arrow/type_benchmark.cc +++ b/cpp/src/arrow/type_benchmark.cc @@ -22,14 +22,13 @@ #include #include -#include "benchmark/benchmark.h" - #include "arrow/result.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" #include "arrow/util/key_value_metadata.h" #include "arrow/util/macros.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/type_test.cc b/cpp/src/arrow/type_test.cc index fd7fd01af67fa..f8876e6a7830f 100644 --- a/cpp/src/arrow/type_test.cc +++ b/cpp/src/arrow/type_test.cc @@ -17,6 +17,10 @@ // Unit tests for DataType (and subclasses), Field, and Schema +#include "arrow/type.h" + +#include + #include #include #include @@ -25,12 +29,9 @@ #include #include -#include - #include "arrow/memory_pool.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" -#include "arrow/type.h" #include "arrow/type_traits.h" #include "arrow/util/checked_cast.h" #include "arrow/util/key_value_metadata.h" diff --git a/cpp/src/arrow/util/align_util_test.cc b/cpp/src/arrow/util/align_util_test.cc index 2f6380c62e9be..a22f733f479eb 100644 --- a/cpp/src/arrow/util/align_util_test.cc +++ b/cpp/src/arrow/util/align_util_test.cc @@ -15,15 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/align_util.h" + +#include + #include #include #include #include -#include - -#include "arrow/util/align_util.h" - namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/async_generator_test.cc b/cpp/src/arrow/util/async_generator_test.cc index 474c4f6a0e7c9..591eaae92800d 100644 --- a/cpp/src/arrow/util/async_generator_test.cc +++ b/cpp/src/arrow/util/async_generator_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/async_generator.h" + #include #include #include @@ -25,7 +27,6 @@ #include "arrow/testing/future_util.h" #include "arrow/testing/gtest_util.h" #include "arrow/type_fwd.h" -#include "arrow/util/async_generator.h" #include "arrow/util/optional.h" #include "arrow/util/test_common.h" #include "arrow/util/vector.h" diff --git a/cpp/src/arrow/util/basic_decimal.cc b/cpp/src/arrow/util/basic_decimal.cc index 56809f28165b9..02d1b65e1b1fa 100644 --- a/cpp/src/arrow/util/basic_decimal.cc +++ b/cpp/src/arrow/util/basic_decimal.cc @@ -1303,10 +1303,10 @@ BasicDecimal256 operator*(const BasicDecimal256& left, const BasicDecimal256& ri bool operator<(const BasicDecimal256& left, const BasicDecimal256& right) { const std::array& lhs = left.little_endian_array(); const std::array& rhs = right.little_endian_array(); - return lhs[3] != rhs[3] - ? static_cast(lhs[3]) < static_cast(rhs[3]) - : lhs[2] != rhs[2] ? lhs[2] < rhs[2] - : lhs[1] != rhs[1] ? lhs[1] < rhs[1] : lhs[0] < rhs[0]; + return lhs[3] != rhs[3] ? static_cast(lhs[3]) < static_cast(rhs[3]) + : lhs[2] != rhs[2] ? lhs[2] < rhs[2] + : lhs[1] != rhs[1] ? lhs[1] < rhs[1] + : lhs[0] < rhs[0]; } BasicDecimal256 operator-(const BasicDecimal256& operand) { diff --git a/cpp/src/arrow/util/benchmark_util.h b/cpp/src/arrow/util/benchmark_util.h index 8379948bcbcfe..2fc28c955d73b 100644 --- a/cpp/src/arrow/util/benchmark_util.h +++ b/cpp/src/arrow/util/benchmark_util.h @@ -19,9 +19,8 @@ #include #include -#include "benchmark/benchmark.h" - #include "arrow/util/cpu_info.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/util/bit_block_counter_benchmark.cc b/cpp/src/arrow/util/bit_block_counter_benchmark.cc index 429993442a35c..38a453797afb8 100644 --- a/cpp/src/arrow/util/bit_block_counter_benchmark.cc +++ b/cpp/src/arrow/util/bit_block_counter_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -27,6 +25,7 @@ #include "arrow/util/bit_block_counter.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_reader.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/bit_block_counter_test.cc b/cpp/src/arrow/util/bit_block_counter_test.cc index 3fdfa3ed9cb01..a7d28a5548396 100644 --- a/cpp/src/arrow/util/bit_block_counter_test.cc +++ b/cpp/src/arrow/util/bit_block_counter_test.cc @@ -15,20 +15,21 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/bit_block_counter.h" + +#include + #include #include #include #include -#include - #include "arrow/buffer.h" #include "arrow/memory_pool.h" #include "arrow/result.h" #include "arrow/testing/gtest_common.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" -#include "arrow/util/bit_block_counter.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_ops.h" diff --git a/cpp/src/arrow/util/bit_stream_utils.h b/cpp/src/arrow/util/bit_stream_utils.h index b9e695dfcb079..dedc801150b53 100644 --- a/cpp/src/arrow/util/bit_stream_utils.h +++ b/cpp/src/arrow/util/bit_stream_utils.h @@ -20,6 +20,7 @@ #pragma once #include + #include #include diff --git a/cpp/src/arrow/util/bit_util_benchmark.cc b/cpp/src/arrow/util/bit_util_benchmark.cc index 8a4f3e0c55810..eb82651113c2f 100644 --- a/cpp/src/arrow/util/bit_util_benchmark.cc +++ b/cpp/src/arrow/util/bit_util_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -41,6 +39,7 @@ #include "arrow/util/bitmap_reader.h" #include "arrow/util/bitmap_visit.h" #include "arrow/util/bitmap_writer.h" +#include "benchmark/benchmark.h" namespace arrow { namespace BitUtil { diff --git a/cpp/src/arrow/util/bit_util_test.cc b/cpp/src/arrow/util/bit_util_test.cc index e5a5e4c39bef5..6a3ecafd075bb 100644 --- a/cpp/src/arrow/util/bit_util_test.cc +++ b/cpp/src/arrow/util/bit_util_test.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include @@ -27,9 +30,6 @@ #include #include -#include -#include - #include "arrow/array/array_base.h" #include "arrow/array/data.h" #include "arrow/buffer.h" diff --git a/cpp/src/arrow/util/bpacking.cc b/cpp/src/arrow/util/bpacking.cc index 2e658fd108ece..b53e6cd38218c 100644 --- a/cpp/src/arrow/util/bpacking.cc +++ b/cpp/src/arrow/util/bpacking.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/bpacking.h" + #include "arrow/util/bpacking_default.h" #include "arrow/util/cpu_info.h" #include "arrow/util/dispatch.h" diff --git a/cpp/src/arrow/util/bpacking.h b/cpp/src/arrow/util/bpacking.h index e5a4dbbed89ec..e6718dfaf9425 100644 --- a/cpp/src/arrow/util/bpacking.h +++ b/cpp/src/arrow/util/bpacking.h @@ -17,11 +17,11 @@ #pragma once +#include + #include "arrow/util/endian.h" #include "arrow/util/visibility.h" -#include - namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/bpacking_avx2.cc b/cpp/src/arrow/util/bpacking_avx2.cc index 5a3a7bad3d344..acb99c2586be2 100644 --- a/cpp/src/arrow/util/bpacking_avx2.cc +++ b/cpp/src/arrow/util/bpacking_avx2.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/bpacking_avx2.h" + #include "arrow/util/bpacking_simd256_generated.h" #include "arrow/util/bpacking_simd_internal.h" diff --git a/cpp/src/arrow/util/bpacking_avx512.cc b/cpp/src/arrow/util/bpacking_avx512.cc index 08ccd3fcd4d86..a3722e09d94ed 100644 --- a/cpp/src/arrow/util/bpacking_avx512.cc +++ b/cpp/src/arrow/util/bpacking_avx512.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/bpacking_avx512.h" + #include "arrow/util/bpacking_simd512_generated.h" #include "arrow/util/bpacking_simd_internal.h" diff --git a/cpp/src/arrow/util/bpacking_neon.cc b/cpp/src/arrow/util/bpacking_neon.cc index a0bb5dc7a9e7b..570ea944f978d 100644 --- a/cpp/src/arrow/util/bpacking_neon.cc +++ b/cpp/src/arrow/util/bpacking_neon.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/bpacking_neon.h" + #include "arrow/util/bpacking_simd128_generated.h" #include "arrow/util/bpacking_simd_internal.h" diff --git a/cpp/src/arrow/util/byte_stream_split.h b/cpp/src/arrow/util/byte_stream_split.h index 28dcce52bb8fc..a30b539e5cb91 100644 --- a/cpp/src/arrow/util/byte_stream_split.h +++ b/cpp/src/arrow/util/byte_stream_split.h @@ -17,12 +17,13 @@ #pragma once -#include "arrow/util/simd.h" -#include "arrow/util/ubsan.h" - #include + #include +#include "arrow/util/simd.h" +#include "arrow/util/ubsan.h" + #ifdef ARROW_HAVE_SSE4_2 // Enable the SIMD for ByteStreamSplit Encoder/Decoder #define ARROW_HAVE_SIMD_SPLIT diff --git a/cpp/src/arrow/util/cache_benchmark.cc b/cpp/src/arrow/util/cache_benchmark.cc index 7439ee2f5013f..fccf93a8b54e7 100644 --- a/cpp/src/arrow/util/cache_benchmark.cc +++ b/cpp/src/arrow/util/cache_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -27,6 +25,7 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/cache_test.cc b/cpp/src/arrow/util/cache_test.cc index 6b71baa369b9b..2517d58e72a9a 100644 --- a/cpp/src/arrow/util/cache_test.cc +++ b/cpp/src/arrow/util/cache_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -22,8 +24,6 @@ #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/cache_internal.h" diff --git a/cpp/src/arrow/util/cancel_test.cc b/cpp/src/arrow/util/cancel_test.cc index b9bf94ba43a56..5652afadc1208 100644 --- a/cpp/src/arrow/util/cancel_test.cc +++ b/cpp/src/arrow/util/cancel_test.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include + #include #include #include @@ -22,10 +25,6 @@ #include #include #include - -#include - -#include #ifndef _WIN32 #include // for setitimer() #endif diff --git a/cpp/src/arrow/util/checked_cast_test.cc b/cpp/src/arrow/util/checked_cast_test.cc index b50a859cb0de4..0dc496e8c8628 100644 --- a/cpp/src/arrow/util/checked_cast_test.cc +++ b/cpp/src/arrow/util/checked_cast_test.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "arrow/util/checked_cast.h" #include -#include "arrow/util/checked_cast.h" +#include +#include namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/compression.cc b/cpp/src/arrow/util/compression.cc index 17d056c27dd92..40c4f6a0c1781 100644 --- a/cpp/src/arrow/util/compression.cc +++ b/cpp/src/arrow/util/compression.cc @@ -37,7 +37,8 @@ const std::string& Codec::GetCodecAsString(Compression::type t) { static const std::string uncompressed = "uncompressed", snappy = "snappy", gzip = "gzip", lzo = "lzo", brotli = "brotli", lz4_raw = "lz4_raw", lz4 = "lz4", lz4_hadoop = "lz4_hadoop", - zstd = "zstd", bz2 = "bz2", fastpfor = "fastpfor", unknown = "unknown"; + zstd = "zstd", bz2 = "bz2", fastpfor = "fastpfor", + unknown = "unknown"; switch (t) { case Compression::UNCOMPRESSED: diff --git a/cpp/src/arrow/util/compression_benchmark.cc b/cpp/src/arrow/util/compression_benchmark.cc index c76be275f426c..eddef21e2d10b 100644 --- a/cpp/src/arrow/util/compression_benchmark.cc +++ b/cpp/src/arrow/util/compression_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -29,6 +27,7 @@ #include "arrow/util/compression.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "benchmark/benchmark.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/compression_brotli.cc b/cpp/src/arrow/util/compression_brotli.cc index 4feabe23345af..742f30206b45f 100644 --- a/cpp/src/arrow/util/compression_brotli.cc +++ b/cpp/src/arrow/util/compression_brotli.cc @@ -15,18 +15,17 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression_internal.h" +#include +#include +#include #include #include #include -#include -#include -#include - #include "arrow/result.h" #include "arrow/status.h" +#include "arrow/util/compression_internal.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/util/compression_bz2.cc b/cpp/src/arrow/util/compression_bz2.cc index 8a8c1cb7a45df..033129d773d01 100644 --- a/cpp/src/arrow/util/compression_bz2.cc +++ b/cpp/src/arrow/util/compression_bz2.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression_internal.h" - #include #include #include @@ -24,15 +22,16 @@ #include #include -// Avoid defining max() macro -#include "arrow/util/windows_compatibility.h" +#include "arrow/util/compression_internal.h" +// Avoid defining max() macro #include #include "arrow/result.h" #include "arrow/status.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "arrow/util/windows_compatibility.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/compression_fastpfor.cc b/cpp/src/arrow/util/compression_fastpfor.cc index 6c16982b76f3e..5b9b56551ebd9 100644 --- a/cpp/src/arrow/util/compression_fastpfor.cc +++ b/cpp/src/arrow/util/compression_fastpfor.cc @@ -15,19 +15,17 @@ // specific language governing permissions and limitations // under the License. -#include "compression_internal.h" - -#include - #include #include +#include + #include "arrow/result.h" #include "arrow/status.h" #include "arrow/util/bit_util.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" - +#include "compression_internal.h" #include "fastpfor/codecfactory.h" namespace arrow { diff --git a/cpp/src/arrow/util/compression_internal.h b/cpp/src/arrow/util/compression_internal.h index abf59af2f18b3..2e11574c14385 100644 --- a/cpp/src/arrow/util/compression_internal.h +++ b/cpp/src/arrow/util/compression_internal.h @@ -75,7 +75,7 @@ constexpr int kZSTDDefaultCompressionLevel = 1; std::unique_ptr MakeZSTDCodec( int compression_level = kZSTDDefaultCompressionLevel); -template +template std::unique_ptr MakeFastPForCodec(); } // namespace internal diff --git a/cpp/src/arrow/util/compression_lz4.cc b/cpp/src/arrow/util/compression_lz4.cc index 9314dfd7faf30..1ef373553ca7d 100644 --- a/cpp/src/arrow/util/compression_lz4.cc +++ b/cpp/src/arrow/util/compression_lz4.cc @@ -15,18 +15,17 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression.h" +#include +#include #include #include #include -#include -#include - #include "arrow/result.h" #include "arrow/status.h" #include "arrow/util/bit_util.h" +#include "arrow/util/compression.h" #include "arrow/util/endian.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/util/compression_snappy.cc b/cpp/src/arrow/util/compression_snappy.cc index 9b016874b56be..a172f71ac1ce9 100644 --- a/cpp/src/arrow/util/compression_snappy.cc +++ b/cpp/src/arrow/util/compression_snappy.cc @@ -15,16 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression_internal.h" +#include #include #include #include -#include - #include "arrow/result.h" #include "arrow/status.h" +#include "arrow/util/compression_internal.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/util/compression_test.cc b/cpp/src/arrow/util/compression_test.cc index 062fe1aac4dd7..5817fd21cfa9f 100644 --- a/cpp/src/arrow/util/compression_test.cc +++ b/cpp/src/arrow/util/compression_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/compression.h" + +#include + #include #include #include @@ -24,12 +28,9 @@ #include #include -#include - #include "arrow/result.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" -#include "arrow/util/compression.h" namespace arrow { namespace util { @@ -330,7 +331,6 @@ TEST(TestCodecMisc, GetCodecAsString) { EXPECT_EQ(Codec::GetCodecAsString(Compression::ZSTD), "zstd"); EXPECT_EQ(Codec::GetCodecAsString(Compression::BZ2), "bz2"); EXPECT_EQ(Codec::GetCodecAsString(Compression::FASTPFOR), "fastpfor"); - } TEST(TestCodecMisc, GetCompressionType) { diff --git a/cpp/src/arrow/util/compression_zlib.cc b/cpp/src/arrow/util/compression_zlib.cc index d57a6db29410c..0c264d407c738 100644 --- a/cpp/src/arrow/util/compression_zlib.cc +++ b/cpp/src/arrow/util/compression_zlib.cc @@ -15,7 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression_internal.h" +#include +#include #include #include @@ -23,14 +24,12 @@ #include #include -#include -#include - #include "arrow/result.h" #include "arrow/status.h" +#include "arrow/util/compression_internal.h" +#include "arrow/util/io_util.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" -#include "arrow/util/io_util.h" namespace arrow { namespace util { @@ -495,8 +494,8 @@ class GZipCodec : public Codec { // ---------------------------------------------------------------------- // QAT implementation #include -__thread QzSession_T g_qzSession = { - .internal = NULL, +__thread QzSession_T g_qzSession = { + .internal = NULL, }; class QatCodec : public Codec { @@ -509,9 +508,9 @@ class QatCodec : public Codec { &uncompressed_size); if (ret == QZ_OK) { return static_cast(uncompressed_size); - } else if(ret == QZ_PARAMS) { + } else if (ret == QZ_PARAMS) { return Status::IOError("QAT decompression failure: params is invalid"); - } else if(ret == QZ_FAIL) { + } else if (ret == QZ_FAIL) { return Status::IOError("QAT decompression failure: Function did not succeed"); } else { return Status::IOError("QAT decompression failure with error:", ret); @@ -532,9 +531,9 @@ class QatCodec : public Codec { &compressed_size, 1); if (ret == QZ_OK) { return static_cast(compressed_size); - } else if(ret == QZ_PARAMS) { + } else if (ret == QZ_PARAMS) { return Status::IOError("QAT compression failure: params is invalid"); - } else if(ret == QZ_FAIL) { + } else if (ret == QZ_FAIL) { return Status::IOError("QAT compression failure: function did not succeed"); } else { return Status::IOError("QAT compression failure with error:", ret); diff --git a/cpp/src/arrow/util/compression_zstd.cc b/cpp/src/arrow/util/compression_zstd.cc index 382e0573b2912..30839e58bb44b 100644 --- a/cpp/src/arrow/util/compression_zstd.cc +++ b/cpp/src/arrow/util/compression_zstd.cc @@ -15,16 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/compression_internal.h" +#include #include #include #include -#include - #include "arrow/result.h" #include "arrow/status.h" +#include "arrow/util/compression_internal.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/util/cpu_info.cc b/cpp/src/arrow/util/cpu_info.cc index d803521a2d90d..3b430b1bf8077 100644 --- a/cpp/src/arrow/util/cpu_info.cc +++ b/cpp/src/arrow/util/cpu_info.cc @@ -33,6 +33,7 @@ #ifdef _WIN32 #include #include + #include #include diff --git a/cpp/src/arrow/util/decimal.cc b/cpp/src/arrow/util/decimal.cc index 7aefd1ab9cd7c..62f830fcf31b1 100644 --- a/cpp/src/arrow/util/decimal.cc +++ b/cpp/src/arrow/util/decimal.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/decimal.h" + #include #include #include @@ -29,7 +31,6 @@ #include #include "arrow/status.h" -#include "arrow/util/decimal.h" #include "arrow/util/endian.h" #include "arrow/util/formatting.h" #include "arrow/util/int128_internal.h" diff --git a/cpp/src/arrow/util/decimal_benchmark.cc b/cpp/src/arrow/util/decimal_benchmark.cc index 0cb82387b145a..daeab803e3ccb 100644 --- a/cpp/src/arrow/util/decimal_benchmark.cc +++ b/cpp/src/arrow/util/decimal_benchmark.cc @@ -15,14 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include "arrow/util/decimal.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "benchmark/benchmark.h" namespace arrow { namespace Decimal { diff --git a/cpp/src/arrow/util/decimal_test.cc b/cpp/src/arrow/util/decimal_test.cc index fdcbd945e66dc..dba53b2675403 100644 --- a/cpp/src/arrow/util/decimal_test.cc +++ b/cpp/src/arrow/util/decimal_test.cc @@ -15,8 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/decimal.h" + +#include + #include #include +#include #include #include #include @@ -26,13 +31,9 @@ #include #include -#include -#include - #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" -#include "arrow/util/decimal.h" #include "arrow/util/endian.h" #include "arrow/util/int128_internal.h" #include "arrow/util/macros.h" diff --git a/cpp/src/arrow/util/delimiting.cc b/cpp/src/arrow/util/delimiting.cc index 1b23c3770528e..f8a697880b5b8 100644 --- a/cpp/src/arrow/util/delimiting.cc +++ b/cpp/src/arrow/util/delimiting.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/delimiting.h" + #include "arrow/buffer.h" namespace arrow { diff --git a/cpp/src/arrow/util/formatting.cc b/cpp/src/arrow/util/formatting.cc index c16d42ce5cfe2..9fda278096a2e 100644 --- a/cpp/src/arrow/util/formatting.cc +++ b/cpp/src/arrow/util/formatting.cc @@ -16,6 +16,7 @@ // under the License. #include "arrow/util/formatting.h" + #include "arrow/util/config.h" #include "arrow/util/double_conversion.h" #include "arrow/util/logging.h" diff --git a/cpp/src/arrow/util/formatting_util_test.cc b/cpp/src/arrow/util/formatting_util_test.cc index 35985c0430596..62040d2bfe804 100644 --- a/cpp/src/arrow/util/formatting_util_test.cc +++ b/cpp/src/arrow/util/formatting_util_test.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include -#include - #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/type.h" diff --git a/cpp/src/arrow/util/future_test.cc b/cpp/src/arrow/util/future_test.cc index a505df5ef04f3..85c0c7a73b153 100644 --- a/cpp/src/arrow/util/future_test.cc +++ b/cpp/src/arrow/util/future_test.cc @@ -16,7 +16,9 @@ // under the License. #include "arrow/util/future.h" -#include "arrow/util/future_iterator.h" + +#include +#include #include #include @@ -29,11 +31,9 @@ #include #include -#include -#include - #include "arrow/testing/future_util.h" #include "arrow/testing/gtest_util.h" +#include "arrow/util/future_iterator.h" #include "arrow/util/logging.h" #include "arrow/util/thread_pool.h" diff --git a/cpp/src/arrow/util/hashing_benchmark.cc b/cpp/src/arrow/util/hashing_benchmark.cc index c7051d1a35155..99157b4e12263 100644 --- a/cpp/src/arrow/util/hashing_benchmark.cc +++ b/cpp/src/arrow/util/hashing_benchmark.cc @@ -22,10 +22,9 @@ #include #include -#include "benchmark/benchmark.h" - #include "arrow/testing/gtest_util.h" #include "arrow/util/hashing.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/hashing_test.cc b/cpp/src/arrow/util/hashing_test.cc index 116e305e59e6c..1440b01e6684c 100644 --- a/cpp/src/arrow/util/hashing_test.cc +++ b/cpp/src/arrow/util/hashing_test.cc @@ -15,6 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/hashing.h" + +#include +#include + #include #include #include @@ -25,12 +30,8 @@ #include #include -#include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/bit_util.h" -#include "arrow/util/hashing.h" #include "arrow/util/logging.h" namespace arrow { diff --git a/cpp/src/arrow/util/int_util_benchmark.cc b/cpp/src/arrow/util/int_util_benchmark.cc index 1eae604a7dab8..acf0348e3a6b1 100644 --- a/cpp/src/arrow/util/int_util_benchmark.cc +++ b/cpp/src/arrow/util/int_util_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include @@ -25,6 +23,7 @@ #include "arrow/testing/random.h" #include "arrow/util/benchmark_util.h" #include "arrow/util/int_util.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/int_util_test.cc b/cpp/src/arrow/util/int_util_test.cc index 333154c5cecef..722ae2f544e96 100644 --- a/cpp/src/arrow/util/int_util_test.cc +++ b/cpp/src/arrow/util/int_util_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/int_util.h" + +#include + #include #include #include @@ -22,13 +26,10 @@ #include #include -#include - #include "arrow/datum.h" #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/type.h" -#include "arrow/util/int_util.h" #include "arrow/util/int_util_internal.h" namespace arrow { diff --git a/cpp/src/arrow/util/io_util.cc b/cpp/src/arrow/util/io_util.cc index 5e6da2fb9d637..d43b01d1eb581 100644 --- a/cpp/src/arrow/util/io_util.cc +++ b/cpp/src/arrow/util/io_util.cc @@ -31,7 +31,11 @@ #define __EXTENSIONS__ #endif -#include "arrow/util/windows_compatibility.h" // IWYU pragma: keep +#include +#include +#include +#include +#include // IWYU pragma: keep #include #include @@ -44,11 +48,7 @@ #include #include -#include -#include -#include -#include -#include // IWYU pragma: keep +#include "arrow/util/windows_compatibility.h" // IWYU pragma: keep // ---------------------------------------------------------------------- // file compatibility stuff diff --git a/cpp/src/arrow/util/io_util_test.cc b/cpp/src/arrow/util/io_util_test.cc index a423ecd0152c7..8cdc0644d3a59 100644 --- a/cpp/src/arrow/util/io_util_test.cc +++ b/cpp/src/arrow/util/io_util_test.cc @@ -16,6 +16,8 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include @@ -23,8 +25,6 @@ #include #include -#include - #ifndef _WIN32 #include #endif diff --git a/cpp/src/arrow/util/iterator_test.cc b/cpp/src/arrow/util/iterator_test.cc index 60b57dea1e21d..10ee5593db45f 100644 --- a/cpp/src/arrow/util/iterator_test.cc +++ b/cpp/src/arrow/util/iterator_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/iterator.h" + #include #include #include @@ -28,7 +30,6 @@ #include "arrow/testing/gtest_util.h" #include "arrow/util/async_generator.h" -#include "arrow/util/iterator.h" #include "arrow/util/test_common.h" #include "arrow/util/vector.h" namespace arrow { diff --git a/cpp/src/arrow/util/key_value_metadata.cc b/cpp/src/arrow/util/key_value_metadata.cc index 4c6af29dab7bc..4173a25a38705 100644 --- a/cpp/src/arrow/util/key_value_metadata.cc +++ b/cpp/src/arrow/util/key_value_metadata.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/key_value_metadata.h" + #include #include #include @@ -28,7 +30,6 @@ #include "arrow/result.h" #include "arrow/status.h" -#include "arrow/util/key_value_metadata.h" #include "arrow/util/logging.h" #include "arrow/util/sort.h" diff --git a/cpp/src/arrow/util/key_value_metadata_test.cc b/cpp/src/arrow/util/key_value_metadata_test.cc index 3cdcf94757997..bcf5fb274091b 100644 --- a/cpp/src/arrow/util/key_value_metadata_test.cc +++ b/cpp/src/arrow/util/key_value_metadata_test.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/key_value_metadata.h" + +#include + #include #include #include #include #include -#include - #include "arrow/testing/gtest_util.h" -#include "arrow/util/key_value_metadata.h" namespace arrow { diff --git a/cpp/src/arrow/util/logging.cc b/cpp/src/arrow/util/logging.cc index 04fcf3d3ed618..8edd2dd1fe244 100644 --- a/cpp/src/arrow/util/logging.cc +++ b/cpp/src/arrow/util/logging.cc @@ -26,6 +26,7 @@ #ifdef ARROW_USE_GLOG #include + #include #include "glog/logging.h" diff --git a/cpp/src/arrow/util/logging_test.cc b/cpp/src/arrow/util/logging_test.cc index 547e0bba3c5f7..27a28ea1f61e7 100644 --- a/cpp/src/arrow/util/logging_test.cc +++ b/cpp/src/arrow/util/logging_test.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "arrow/util/logging.h" #include -#include "arrow/util/logging.h" +#include +#include +#include // This code is adapted from // https://github.com/ray-project/ray/blob/master/src/ray/util/logging_test.cc. diff --git a/cpp/src/arrow/util/memory.cc b/cpp/src/arrow/util/memory.cc index e91009d5860b7..856dc7f8d6fa1 100644 --- a/cpp/src/arrow/util/memory.cc +++ b/cpp/src/arrow/util/memory.cc @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/memory.h" + #include #include "arrow/util/logging.h" -#include "arrow/util/memory.h" #include "arrow/util/thread_pool.h" namespace arrow { diff --git a/cpp/src/arrow/util/queue_benchmark.cc b/cpp/src/arrow/util/queue_benchmark.cc index 675bef8311a9c..5059bbdc8320e 100644 --- a/cpp/src/arrow/util/queue_benchmark.cc +++ b/cpp/src/arrow/util/queue_benchmark.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include -#include - #include "arrow/buffer.h" #include "arrow/util/logging.h" #include "arrow/util/queue.h" diff --git a/cpp/src/arrow/util/queue_test.cc b/cpp/src/arrow/util/queue_test.cc index 388e4f11ba674..9e18b5bf0af11 100644 --- a/cpp/src/arrow/util/queue_test.cc +++ b/cpp/src/arrow/util/queue_test.cc @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/queue.h" + #include #include "arrow/testing/gtest_util.h" -#include "arrow/util/queue.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/range_benchmark.cc b/cpp/src/arrow/util/range_benchmark.cc index 204fd24f791d0..9e178e63acb1a 100644 --- a/cpp/src/arrow/util/range_benchmark.cc +++ b/cpp/src/arrow/util/range_benchmark.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include -#include - #include "arrow/testing/random.h" #include "arrow/testing/util.h" #include "arrow/util/range.h" diff --git a/cpp/src/arrow/util/range_test.cc b/cpp/src/arrow/util/range_test.cc index 7fedcde998367..ba885ae3adfae 100644 --- a/cpp/src/arrow/util/range_test.cc +++ b/cpp/src/arrow/util/range_test.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/range.h" + +#include + #include #include #include #include -#include - #include "arrow/testing/random.h" #include "arrow/testing/util.h" -#include "arrow/util/range.h" namespace arrow { diff --git a/cpp/src/arrow/util/rle_encoding_test.cc b/cpp/src/arrow/util/rle_encoding_test.cc index 362f8253ccd6f..704d4491aa4f7 100644 --- a/cpp/src/arrow/util/rle_encoding_test.cc +++ b/cpp/src/arrow/util/rle_encoding_test.cc @@ -17,13 +17,15 @@ // From Apache Impala (incubating) as of 2016-01-29 +#include "arrow/util/rle_encoding.h" + +#include + #include #include #include #include -#include - #include "arrow/array.h" #include "arrow/buffer.h" #include "arrow/testing/random.h" @@ -31,7 +33,6 @@ #include "arrow/util/bit_stream_utils.h" #include "arrow/util/bit_util.h" #include "arrow/util/io_util.h" -#include "arrow/util/rle_encoding.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/stl_util_test.cc b/cpp/src/arrow/util/stl_util_test.cc index 2a8784e13a8e8..d155fc8d215c6 100644 --- a/cpp/src/arrow/util/stl_util_test.cc +++ b/cpp/src/arrow/util/stl_util_test.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. -#include -#include - #include #include +#include +#include + #include "arrow/testing/gtest_util.h" #include "arrow/util/sort.h" #include "arrow/util/string.h" diff --git a/cpp/src/arrow/util/string_test.cc b/cpp/src/arrow/util/string_test.cc index 057d885fcdb75..039326db42c60 100644 --- a/cpp/src/arrow/util/string_test.cc +++ b/cpp/src/arrow/util/string_test.cc @@ -15,15 +15,16 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/string.h" + +#include + #include #include #include -#include - #include "arrow/status.h" #include "arrow/testing/gtest_util.h" -#include "arrow/util/string.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/task_group_test.cc b/cpp/src/arrow/util/task_group_test.cc index 4913fb9294c2f..23114b1372239 100644 --- a/cpp/src/arrow/util/task_group_test.cc +++ b/cpp/src/arrow/util/task_group_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/task_group.h" + +#include + #include #include #include @@ -26,12 +30,9 @@ #include #include -#include - #include "arrow/status.h" #include "arrow/testing/future_util.h" #include "arrow/testing/gtest_util.h" -#include "arrow/util/task_group.h" #include "arrow/util/thread_pool.h" namespace arrow { diff --git a/cpp/src/arrow/util/tdigest_benchmark.cc b/cpp/src/arrow/util/tdigest_benchmark.cc index 0b954509034aa..9167a63338f7b 100644 --- a/cpp/src/arrow/util/tdigest_benchmark.cc +++ b/cpp/src/arrow/util/tdigest_benchmark.cc @@ -15,11 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/tdigest.h" +#include "benchmark/benchmark.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/tdigest_test.cc b/cpp/src/arrow/util/tdigest_test.cc index e9a3924f812e7..e57540cd75351 100644 --- a/cpp/src/arrow/util/tdigest_test.cc +++ b/cpp/src/arrow/util/tdigest_test.cc @@ -23,16 +23,17 @@ // To make test result stable, I relaxed error bound to be *good enough*. // #define _TDIGEST_STRICT_TEST // enable more strict tests +#include "arrow/util/tdigest.h" + +#include + #include #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/testing/util.h" -#include "arrow/util/tdigest.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/thread_pool_benchmark.cc b/cpp/src/arrow/util/thread_pool_benchmark.cc index b02ca9bb54b95..9619b291caa4f 100644 --- a/cpp/src/arrow/util/thread_pool_benchmark.cc +++ b/cpp/src/arrow/util/thread_pool_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -31,6 +29,7 @@ #include "arrow/testing/gtest_util.h" #include "arrow/util/task_group.h" #include "arrow/util/thread_pool.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/thread_pool_test.cc b/cpp/src/arrow/util/thread_pool_test.cc index 9926ac1a7a4d2..3cad228e433ab 100644 --- a/cpp/src/arrow/util/thread_pool_test.cc +++ b/cpp/src/arrow/util/thread_pool_test.cc @@ -20,6 +20,8 @@ #include #endif +#include + #include #include #include @@ -29,8 +31,6 @@ #include #include -#include - #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" diff --git a/cpp/src/arrow/util/time.cc b/cpp/src/arrow/util/time.cc index c285f0750994f..5c613737fd0ed 100644 --- a/cpp/src/arrow/util/time.cc +++ b/cpp/src/arrow/util/time.cc @@ -15,11 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/time.h" + #include #include "arrow/type.h" #include "arrow/util/checked_cast.h" -#include "arrow/util/time.h" namespace arrow { diff --git a/cpp/src/arrow/util/time_test.cc b/cpp/src/arrow/util/time_test.cc index 0224cca49aac1..7549dce6c5150 100644 --- a/cpp/src/arrow/util/time_test.cc +++ b/cpp/src/arrow/util/time_test.cc @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/time.h" + #include #include "arrow/testing/gtest_util.h" -#include "arrow/util/time.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/trie_benchmark.cc b/cpp/src/arrow/util/trie_benchmark.cc index 868accc374477..625e9d97aa4b9 100644 --- a/cpp/src/arrow/util/trie_benchmark.cc +++ b/cpp/src/arrow/util/trie_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -24,6 +22,7 @@ #include "arrow/status.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/trie.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/trie_test.cc b/cpp/src/arrow/util/trie_test.cc index cfe66689da59d..1caee90edeee7 100644 --- a/cpp/src/arrow/util/trie_test.cc +++ b/cpp/src/arrow/util/trie_test.cc @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/trie.h" + +#include + #include #include #include @@ -23,10 +27,7 @@ #include #include -#include - #include "arrow/testing/gtest_util.h" -#include "arrow/util/trie.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/uri_test.cc b/cpp/src/arrow/util/uri_test.cc index 169e9c81b36ba..2d62f96839878 100644 --- a/cpp/src/arrow/util/uri_test.cc +++ b/cpp/src/arrow/util/uri_test.cc @@ -15,16 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/uri.h" + +#include + #include #include #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/logging.h" -#include "arrow/util/uri.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/utf8.cc b/cpp/src/arrow/util/utf8.cc index 478d8ade95f79..b90784b6a6794 100644 --- a/cpp/src/arrow/util/utf8.cc +++ b/cpp/src/arrow/util/utf8.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "arrow/util/utf8.h" + #include #include #include @@ -23,7 +25,6 @@ #include "arrow/result.h" #include "arrow/util/logging.h" -#include "arrow/util/utf8.h" #include "arrow/vendored/utfcpp/checked.h" // Can be defined by utfcpp diff --git a/cpp/src/arrow/util/utf8_util_benchmark.cc b/cpp/src/arrow/util/utf8_util_benchmark.cc index 32ccf0a8ec14a..4dbe487d5260d 100644 --- a/cpp/src/arrow/util/utf8_util_benchmark.cc +++ b/cpp/src/arrow/util/utf8_util_benchmark.cc @@ -15,14 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include #include "arrow/testing/gtest_util.h" #include "arrow/util/utf8.h" +#include "benchmark/benchmark.h" namespace arrow { namespace util { diff --git a/cpp/src/arrow/util/utf8_util_test.cc b/cpp/src/arrow/util/utf8_util_test.cc index 8b6713623c487..19e621b844684 100644 --- a/cpp/src/arrow/util/utf8_util_test.cc +++ b/cpp/src/arrow/util/utf8_util_test.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include + #include #include #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/string.h" #include "arrow/util/utf8.h" diff --git a/cpp/src/arrow/util/value_parsing_benchmark.cc b/cpp/src/arrow/util/value_parsing_benchmark.cc index c113c245fff3a..0343eab2a2972 100644 --- a/cpp/src/arrow/util/value_parsing_benchmark.cc +++ b/cpp/src/arrow/util/value_parsing_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -34,6 +32,7 @@ #include "arrow/util/formatting.h" #include "arrow/util/string_view.h" #include "arrow/util/value_parsing.h" +#include "benchmark/benchmark.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/value_parsing_test.cc b/cpp/src/arrow/util/value_parsing_test.cc index e790a10acf1f9..b374ba9642ca4 100644 --- a/cpp/src/arrow/util/value_parsing_test.cc +++ b/cpp/src/arrow/util/value_parsing_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "arrow/util/value_parsing.h" #include +#include +#include + #include "arrow/testing/gtest_util.h" #include "arrow/type.h" -#include "arrow/util/value_parsing.h" namespace arrow { namespace internal { diff --git a/cpp/src/arrow/util/variant_benchmark.cc b/cpp/src/arrow/util/variant_benchmark.cc index af3fafb8b0e35..357f4b22da27b 100644 --- a/cpp/src/arrow/util/variant_benchmark.cc +++ b/cpp/src/arrow/util/variant_benchmark.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include @@ -32,6 +30,7 @@ #include "arrow/type.h" #include "arrow/util/checked_cast.h" #include "arrow/util/variant.h" +#include "benchmark/benchmark.h" namespace arrow { diff --git a/cpp/src/arrow/util/variant_test.cc b/cpp/src/arrow/util/variant_test.cc index 9e36f2eb9cfac..ce7b308f283ed 100644 --- a/cpp/src/arrow/util/variant_test.cc +++ b/cpp/src/arrow/util/variant_test.cc @@ -17,15 +17,15 @@ #include "arrow/util/variant.h" +#include +#include + #include #include #include #include #include -#include -#include - #include "arrow/testing/gtest_compat.h" namespace arrow { diff --git a/cpp/src/gandiva/annotator_test.cc b/cpp/src/gandiva/annotator_test.cc index e537943d96f53..3cbd46348f564 100644 --- a/cpp/src/gandiva/annotator_test.cc +++ b/cpp/src/gandiva/annotator_test.cc @@ -17,11 +17,12 @@ #include "gandiva/annotator.h" +#include +#include + #include #include -#include -#include #include "gandiva/field_descriptor.h" namespace gandiva { diff --git a/cpp/src/gandiva/bitmap_accumulator_test.cc b/cpp/src/gandiva/bitmap_accumulator_test.cc index ccffab3e9ff8d..1033cb40d90be 100644 --- a/cpp/src/gandiva/bitmap_accumulator_test.cc +++ b/cpp/src/gandiva/bitmap_accumulator_test.cc @@ -17,15 +17,14 @@ #include "gandiva/bitmap_accumulator.h" +#include + #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/testing/util.h" #include "arrow/util/bitmap_ops.h" - #include "gandiva/dex.h" namespace gandiva { diff --git a/cpp/src/gandiva/cache.cc b/cpp/src/gandiva/cache.cc index d823a676bc2f7..645482fb40ae9 100644 --- a/cpp/src/gandiva/cache.cc +++ b/cpp/src/gandiva/cache.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/cache.h" + #include "arrow/util/logging.h" namespace gandiva { diff --git a/cpp/src/gandiva/cast_time.cc b/cpp/src/gandiva/cast_time.cc index 843ce01f89d57..3cae9f830cf54 100644 --- a/cpp/src/gandiva/cast_time.cc +++ b/cpp/src/gandiva/cast_time.cc @@ -18,15 +18,13 @@ #include #include "arrow/vendored/datetime.h" - #include "gandiva/precompiled/time_fields.h" #ifndef GANDIVA_UNIT_TEST +#include "gandiva/engine.h" #include "gandiva/exported_funcs.h" #include "gandiva/gdv_function_stubs.h" -#include "gandiva/engine.h" - namespace gandiva { void ExportedTimeFunctions::AddMappings(Engine* engine) const { diff --git a/cpp/src/gandiva/compiled_expr.h b/cpp/src/gandiva/compiled_expr.h index ba0ca3437ded4..f9b8a039fa9f1 100644 --- a/cpp/src/gandiva/compiled_expr.h +++ b/cpp/src/gandiva/compiled_expr.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/llvm_includes.h" #include "gandiva/selection_vector.h" #include "gandiva/value_validity_pair.h" diff --git a/cpp/src/gandiva/context_helper.cc b/cpp/src/gandiva/context_helper.cc index 224bfd8f56cd3..d1e7c8e36dfea 100644 --- a/cpp/src/gandiva/context_helper.cc +++ b/cpp/src/gandiva/context_helper.cc @@ -18,11 +18,10 @@ // This file is also used in the pre-compiled unit tests, which do include // llvm/engine/.. #ifndef GANDIVA_UNIT_TEST +#include "gandiva/engine.h" #include "gandiva/exported_funcs.h" #include "gandiva/gdv_function_stubs.h" -#include "gandiva/engine.h" - namespace gandiva { void ExportedContextFunctions::AddMappings(Engine* engine) const { diff --git a/cpp/src/gandiva/date_utils.cc b/cpp/src/gandiva/date_utils.cc index f0a80d3c95921..e40aa369312fa 100644 --- a/cpp/src/gandiva/date_utils.cc +++ b/cpp/src/gandiva/date_utils.cc @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/date_utils.h" + #include #include #include #include #include -#include "gandiva/date_utils.h" - namespace gandiva { std::vector DateUtils::GetMatches(std::string pattern, bool exactMatch) { diff --git a/cpp/src/gandiva/date_utils.h b/cpp/src/gandiva/date_utils.h index 0d39a5f292291..5e9a374affaa4 100644 --- a/cpp/src/gandiva/date_utils.h +++ b/cpp/src/gandiva/date_utils.h @@ -23,7 +23,6 @@ #include #include "arrow/util/macros.h" - #include "gandiva/arrow.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/decimal_ir.cc b/cpp/src/gandiva/decimal_ir.cc index 8ccd00fc9498a..c894e0e6754b1 100644 --- a/cpp/src/gandiva/decimal_ir.cc +++ b/cpp/src/gandiva/decimal_ir.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/decimal_ir.h" + #include #include #include #include "arrow/status.h" -#include "gandiva/decimal_ir.h" #include "gandiva/decimal_type_util.h" // Algorithms adapted from Apache Impala diff --git a/cpp/src/gandiva/decimal_scalar.h b/cpp/src/gandiva/decimal_scalar.h index a03807b359af4..abf7a23ff9cf5 100644 --- a/cpp/src/gandiva/decimal_scalar.h +++ b/cpp/src/gandiva/decimal_scalar.h @@ -19,6 +19,7 @@ #include #include + #include "arrow/util/decimal.h" #include "arrow/util/hash_util.h" #include "gandiva/basic_decimal_scalar.h" diff --git a/cpp/src/gandiva/decimal_type_util.cc b/cpp/src/gandiva/decimal_type_util.cc index 2abc5a21eaa88..5d5b9bf72d328 100644 --- a/cpp/src/gandiva/decimal_type_util.cc +++ b/cpp/src/gandiva/decimal_type_util.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/decimal_type_util.h" + #include "arrow/util/logging.h" namespace gandiva { diff --git a/cpp/src/gandiva/decimal_type_util_test.cc b/cpp/src/gandiva/decimal_type_util_test.cc index 98ea0bb16ac76..91515e5614bc9 100644 --- a/cpp/src/gandiva/decimal_type_util_test.cc +++ b/cpp/src/gandiva/decimal_type_util_test.cc @@ -17,9 +17,10 @@ // Adapted from Apache Impala +#include "gandiva/decimal_type_util.h" + #include -#include "gandiva/decimal_type_util.h" #include "tests/test_util.h" namespace gandiva { diff --git a/cpp/src/gandiva/engine.h b/cpp/src/gandiva/engine.h index d26b8aa0ea96c..65f784bce925a 100644 --- a/cpp/src/gandiva/engine.h +++ b/cpp/src/gandiva/engine.h @@ -22,9 +22,8 @@ #include #include -#include "arrow/util/macros.h" - #include "arrow/util/logging.h" +#include "arrow/util/macros.h" #include "gandiva/configuration.h" #include "gandiva/llvm_includes.h" #include "gandiva/llvm_types.h" diff --git a/cpp/src/gandiva/engine_llvm_test.cc b/cpp/src/gandiva/engine_llvm_test.cc index d5a6c04b3bb3b..5fd0faa8434a4 100644 --- a/cpp/src/gandiva/engine_llvm_test.cc +++ b/cpp/src/gandiva/engine_llvm_test.cc @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include "gandiva/engine.h" - #include + #include + +#include "gandiva/engine.h" #include "gandiva/llvm_types.h" #include "gandiva/tests/test_util.h" diff --git a/cpp/src/gandiva/eval_batch.h b/cpp/src/gandiva/eval_batch.h index 25d9ab1d9f6ee..5921ad3761acd 100644 --- a/cpp/src/gandiva/eval_batch.h +++ b/cpp/src/gandiva/eval_batch.h @@ -20,7 +20,6 @@ #include #include "arrow/util/logging.h" - #include "gandiva/arrow.h" #include "gandiva/execution_context.h" #include "gandiva/gandiva_aliases.h" diff --git a/cpp/src/gandiva/execution_context.h b/cpp/src/gandiva/execution_context.h index efa5468744567..aee0591acbe22 100644 --- a/cpp/src/gandiva/execution_context.h +++ b/cpp/src/gandiva/execution_context.h @@ -19,6 +19,7 @@ #include #include + #include "gandiva/simple_arena.h" namespace gandiva { diff --git a/cpp/src/gandiva/exported_funcs.h b/cpp/src/gandiva/exported_funcs.h index 58205266094d9..57d83c0bc3d20 100644 --- a/cpp/src/gandiva/exported_funcs.h +++ b/cpp/src/gandiva/exported_funcs.h @@ -18,6 +18,7 @@ #pragma once #include + #include namespace gandiva { diff --git a/cpp/src/gandiva/exported_funcs_registry.h b/cpp/src/gandiva/exported_funcs_registry.h index 1504f213005a9..da14efb6f5e7a 100644 --- a/cpp/src/gandiva/exported_funcs_registry.h +++ b/cpp/src/gandiva/exported_funcs_registry.h @@ -17,11 +17,11 @@ #pragma once +#include + #include #include -#include - namespace gandiva { class ExportedFuncsBase; diff --git a/cpp/src/gandiva/expr_validator.cc b/cpp/src/gandiva/expr_validator.cc index fd46c2894b9ce..0725a334cc36e 100644 --- a/cpp/src/gandiva/expr_validator.cc +++ b/cpp/src/gandiva/expr_validator.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/expr_validator.h" + #include #include #include -#include "gandiva/expr_validator.h" - namespace gandiva { Status ExprValidator::Validate(const ExpressionPtr& expr) { diff --git a/cpp/src/gandiva/expr_validator.h b/cpp/src/gandiva/expr_validator.h index e25afe5e7e826..9bb2f353430b7 100644 --- a/cpp/src/gandiva/expr_validator.h +++ b/cpp/src/gandiva/expr_validator.h @@ -21,7 +21,6 @@ #include #include "arrow/status.h" - #include "gandiva/arrow.h" #include "gandiva/expression.h" #include "gandiva/function_registry.h" diff --git a/cpp/src/gandiva/expression.cc b/cpp/src/gandiva/expression.cc index 06aada27b3c1c..67f4944e2f261 100644 --- a/cpp/src/gandiva/expression.cc +++ b/cpp/src/gandiva/expression.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/expression.h" + #include "gandiva/node.h" namespace gandiva { diff --git a/cpp/src/gandiva/expression_registry.cc b/cpp/src/gandiva/expression_registry.cc index c3a08fd3a4f01..9bff97f5ad269 100644 --- a/cpp/src/gandiva/expression_registry.cc +++ b/cpp/src/gandiva/expression_registry.cc @@ -60,8 +60,8 @@ FunctionSignature ExpressionRegistry::FunctionSignatureIterator::operator*() { return *func_sig_it_; } -ExpressionRegistry::func_sig_iterator_type ExpressionRegistry::FunctionSignatureIterator:: -operator++(int increment) { +ExpressionRegistry::func_sig_iterator_type +ExpressionRegistry::FunctionSignatureIterator::operator++(int increment) { ++func_sig_it_; // point func_sig_it_ to first signature of next nativefunction if func_sig_it_ is // pointing to end diff --git a/cpp/src/gandiva/expression_registry_test.cc b/cpp/src/gandiva/expression_registry_test.cc index c254ff4f3aa5e..d3fbf8421ff0b 100644 --- a/cpp/src/gandiva/expression_registry_test.cc +++ b/cpp/src/gandiva/expression_registry_test.cc @@ -17,10 +17,11 @@ #include "gandiva/expression_registry.h" +#include + #include #include -#include #include "gandiva/function_registry.h" #include "gandiva/function_signature.h" #include "gandiva/llvm_types.h" diff --git a/cpp/src/gandiva/filter.cc b/cpp/src/gandiva/filter.cc index 5546c097b06a2..b53804c05bcea 100644 --- a/cpp/src/gandiva/filter.cc +++ b/cpp/src/gandiva/filter.cc @@ -23,7 +23,6 @@ #include #include "arrow/util/hash_util.h" - #include "gandiva/bitmap_accumulator.h" #include "gandiva/cache.h" #include "gandiva/condition.h" diff --git a/cpp/src/gandiva/filter.h b/cpp/src/gandiva/filter.h index 70ccd7cf0ceee..045b83b57a0c8 100644 --- a/cpp/src/gandiva/filter.h +++ b/cpp/src/gandiva/filter.h @@ -23,7 +23,6 @@ #include #include "arrow/status.h" - #include "gandiva/arrow.h" #include "gandiva/condition.h" #include "gandiva/configuration.h" diff --git a/cpp/src/gandiva/function_holder_registry.h b/cpp/src/gandiva/function_holder_registry.h index ed111c86dcfdf..ab4072987ee6c 100644 --- a/cpp/src/gandiva/function_holder_registry.h +++ b/cpp/src/gandiva/function_holder_registry.h @@ -23,7 +23,6 @@ #include #include "arrow/status.h" - #include "gandiva/function_holder.h" #include "gandiva/json_holder.h" #include "gandiva/like_holder.h" diff --git a/cpp/src/gandiva/function_registry.cc b/cpp/src/gandiva/function_registry.cc index d5d015c10b4b4..dbdac7d025867 100644 --- a/cpp/src/gandiva/function_registry.cc +++ b/cpp/src/gandiva/function_registry.cc @@ -16,6 +16,11 @@ // under the License. #include "gandiva/function_registry.h" + +#include +#include +#include + #include "gandiva/function_registry_arithmetic.h" #include "gandiva/function_registry_datetime.h" #include "gandiva/function_registry_hash.h" @@ -23,10 +28,6 @@ #include "gandiva/function_registry_string.h" #include "gandiva/function_registry_timestamp_arithmetic.h" -#include -#include -#include - namespace gandiva { FunctionRegistry::iterator FunctionRegistry::begin() const { diff --git a/cpp/src/gandiva/function_registry.h b/cpp/src/gandiva/function_registry.h index d9256326019c6..33c25335908ac 100644 --- a/cpp/src/gandiva/function_registry.h +++ b/cpp/src/gandiva/function_registry.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/function_registry_common.h" #include "gandiva/gandiva_aliases.h" #include "gandiva/native_function.h" diff --git a/cpp/src/gandiva/function_registry_arithmetic.cc b/cpp/src/gandiva/function_registry_arithmetic.cc index b9c762298cb42..ad810ba98b0de 100644 --- a/cpp/src/gandiva/function_registry_arithmetic.cc +++ b/cpp/src/gandiva/function_registry_arithmetic.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/function_registry_arithmetic.h" + #include "gandiva/function_registry_common.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_arithmetic.h b/cpp/src/gandiva/function_registry_arithmetic.h index 693d3b95ee5be..0425d6490b835 100644 --- a/cpp/src/gandiva/function_registry_arithmetic.h +++ b/cpp/src/gandiva/function_registry_arithmetic.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_common.h b/cpp/src/gandiva/function_registry_common.h index 1c809df53a3d6..64491d974a0b2 100644 --- a/cpp/src/gandiva/function_registry_common.h +++ b/cpp/src/gandiva/function_registry_common.h @@ -55,7 +55,9 @@ inline DataTypePtr time64() { return arrow::time64(arrow::TimeUnit::MICRO); } inline DataTypePtr timestamp() { return arrow::timestamp(arrow::TimeUnit::MILLI); } -inline DataTypePtr timestampusutc() { return arrow::timestamp(arrow::TimeUnit::MICRO, "UTC"); } +inline DataTypePtr timestampusutc() { + return arrow::timestamp(arrow::TimeUnit::MICRO, "UTC"); +} inline DataTypePtr decimal128() { return arrow::decimal(38, 0); } @@ -245,8 +247,9 @@ typedef std::unordered_map GetDateTimeFunctionRegistry() { kResultNullIfNull, "castTIMESTAMP_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), - NativeFunction("castTIMESTAMP_with_validation_check", {}, DataTypeVector{utf8()}, timestamp(), - kResultNullInternal, "castTIMESTAMP_with_validation_check_utf8", + NativeFunction("castTIMESTAMP_with_validation_check", {}, DataTypeVector{utf8()}, + timestamp(), kResultNullInternal, + "castTIMESTAMP_with_validation_check_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), - NativeFunction("castTIMESTAMP_withCarrying", {}, DataTypeVector{utf8()}, timestamp(), - kResultNullInternal, "castTIMESTAMP_withCarrying_utf8", + NativeFunction("castTIMESTAMP_withCarrying", {}, DataTypeVector{utf8()}, + timestamp(), kResultNullInternal, "castTIMESTAMP_withCarrying_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), NativeFunction("castVARCHAR", {}, DataTypeVector{date32(), int64()}, utf8(), @@ -105,11 +106,13 @@ std::vector GetDateTimeFunctionRegistry() { NativeFunction("extractDay", {}, DataTypeVector{day_time_interval()}, int64(), kResultNullIfNull, "extractDay_daytimeinterval"), - NativeFunction("convertTimestampUnit", {}, DataTypeVector{timestamp()}, arrow::timestamp(arrow::TimeUnit::MICRO), - kResultNullIfNull, "convertTimestampUnit_ms"), + NativeFunction("convertTimestampUnit", {}, DataTypeVector{timestamp()}, + arrow::timestamp(arrow::TimeUnit::MICRO), kResultNullIfNull, + "convertTimestampUnit_ms"), - NativeFunction("convertTimestampUnit", {}, DataTypeVector{arrow::timestamp(arrow::TimeUnit::MICRO)}, timestamp(), - kResultNullIfNull, "convertTimestampUnit_us"), + NativeFunction("convertTimestampUnit", {}, + DataTypeVector{arrow::timestamp(arrow::TimeUnit::MICRO)}, + timestamp(), kResultNullIfNull, "convertTimestampUnit_us"), NativeFunction("castDATE", {}, DataTypeVector{date64()}, date32(), kResultNullIfNull, "castDATE32_date64"), @@ -135,15 +138,15 @@ std::vector GetDateTimeFunctionRegistry() { NativeFunction("unix_micros", {}, DataTypeVector{timestampusutc()}, int64(), kResultNullIfNull, "unix_micros_timestampusutc"), - NativeFunction("seconds_to_timestamp", {}, DataTypeVector{int64()}, timestampusutc(), - kResultNullIfNull, "seconds_to_timestamp_int64"), + NativeFunction("seconds_to_timestamp", {}, DataTypeVector{int64()}, + timestampusutc(), kResultNullIfNull, "seconds_to_timestamp_int64"), - NativeFunction("seconds_to_timestamp", {}, DataTypeVector{int32()}, timestampusutc(), - kResultNullIfNull, "seconds_to_timestamp_int32"), + NativeFunction("seconds_to_timestamp", {}, DataTypeVector{int32()}, + timestampusutc(), kResultNullIfNull, "seconds_to_timestamp_int32"), NativeFunction("millis_to_timestamp", {}, DataTypeVector{int64()}, timestampusutc(), kResultNullIfNull, "millis_to_timestamp_int64"), - + NativeFunction("millis_to_timestamp", {}, DataTypeVector{int32()}, timestampusutc(), kResultNullIfNull, "millis_to_timestamp_int32"), diff --git a/cpp/src/gandiva/function_registry_datetime.h b/cpp/src/gandiva/function_registry_datetime.h index 46172ec62869c..97d0a5d4ca13a 100644 --- a/cpp/src/gandiva/function_registry_datetime.h +++ b/cpp/src/gandiva/function_registry_datetime.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_hash.cc b/cpp/src/gandiva/function_registry_hash.cc index 8a0dc55fe4443..2ce399b91b843 100644 --- a/cpp/src/gandiva/function_registry_hash.cc +++ b/cpp/src/gandiva/function_registry_hash.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/function_registry_hash.h" + #include "gandiva/function_registry_common.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_hash.h b/cpp/src/gandiva/function_registry_hash.h index 4f96d30cf5cf6..fb3c4091dfde4 100644 --- a/cpp/src/gandiva/function_registry_hash.h +++ b/cpp/src/gandiva/function_registry_hash.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_math_ops.cc b/cpp/src/gandiva/function_registry_math_ops.cc index 217cd9500ab55..34af84db98c38 100644 --- a/cpp/src/gandiva/function_registry_math_ops.cc +++ b/cpp/src/gandiva/function_registry_math_ops.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/function_registry_math_ops.h" + #include "gandiva/function_registry_common.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_math_ops.h b/cpp/src/gandiva/function_registry_math_ops.h index 2c8a40d533ea1..62584e95e0840 100644 --- a/cpp/src/gandiva/function_registry_math_ops.h +++ b/cpp/src/gandiva/function_registry_math_ops.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_string.cc b/cpp/src/gandiva/function_registry_string.cc index 457b87df9949e..fb0cb8339dd80 100644 --- a/cpp/src/gandiva/function_registry_string.cc +++ b/cpp/src/gandiva/function_registry_string.cc @@ -71,19 +71,19 @@ std::vector GetStringFunctionRegistry() { NativeFunction("castINT", {}, DataTypeVector{utf8()}, int32(), kResultNullIfNull, "gdv_fn_castINT_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), - + // return null if fail to cast - NativeFunction("castINTOrNull", {}, DataTypeVector{utf8()}, int32(), kResultNullInternal, - "gdv_fn_castINT_or_null_utf8", + NativeFunction("castINTOrNull", {}, DataTypeVector{utf8()}, int32(), + kResultNullInternal, "gdv_fn_castINT_or_null_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), NativeFunction("castBIGINT", {}, DataTypeVector{utf8()}, int64(), kResultNullIfNull, "gdv_fn_castBIGINT_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), - + // return null if fail to cast - NativeFunction("castBIGINTOrNull", {}, DataTypeVector{utf8()}, int64(), kResultNullInternal, - "gdv_fn_castBIGINT_or_null_utf8", + NativeFunction("castBIGINTOrNull", {}, DataTypeVector{utf8()}, int64(), + kResultNullInternal, "gdv_fn_castBIGINT_or_null_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), NativeFunction("castFLOAT4", {}, DataTypeVector{utf8()}, float32(), @@ -98,7 +98,7 @@ std::vector GetStringFunctionRegistry() { NativeFunction("castFLOAT8", {}, DataTypeVector{utf8()}, float64(), kResultNullIfNull, "gdv_fn_castFLOAT8_utf8", NativeFunction::kNeedsContext | NativeFunction::kCanReturnErrors), - + // return null if fail to cast NativeFunction("castFLOAT8OrNull", {}, DataTypeVector{utf8()}, float64(), kResultNullInternal, "gdv_fn_castFLOAT8_or_null_utf8", @@ -167,11 +167,12 @@ std::vector GetStringFunctionRegistry() { NativeFunction("ilike", {}, DataTypeVector{utf8(), utf8()}, boolean(), kResultNullIfNull, "gdv_fn_ilike_utf8_utf8", NativeFunction::kNeedsFunctionHolder), - + NativeFunction("get_json_object", {}, DataTypeVector{utf8(), utf8()}, utf8(), kResultNullInternal, "gdv_fn_get_json_object_utf8_utf8", - NativeFunction::kNeedsContext | NativeFunction::kNeedsFunctionHolder | - NativeFunction::kCanReturnErrors), + NativeFunction::kNeedsContext | + NativeFunction::kNeedsFunctionHolder | + NativeFunction::kCanReturnErrors), NativeFunction("ltrim", {}, DataTypeVector{utf8(), utf8()}, utf8(), kResultNullIfNull, "ltrim_utf8_utf8", NativeFunction::kNeedsContext), diff --git a/cpp/src/gandiva/function_registry_string.h b/cpp/src/gandiva/function_registry_string.h index f14c95a817345..28ef314833b6a 100644 --- a/cpp/src/gandiva/function_registry_string.h +++ b/cpp/src/gandiva/function_registry_string.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_test.cc b/cpp/src/gandiva/function_registry_test.cc index e3c1e85f79cba..2c408e9158c8f 100644 --- a/cpp/src/gandiva/function_registry_test.cc +++ b/cpp/src/gandiva/function_registry_test.cc @@ -19,6 +19,7 @@ #include #include + #include #include #include diff --git a/cpp/src/gandiva/function_registry_timestamp_arithmetic.cc b/cpp/src/gandiva/function_registry_timestamp_arithmetic.cc index 4ac7c2c5233f9..db3fa9cd3092c 100644 --- a/cpp/src/gandiva/function_registry_timestamp_arithmetic.cc +++ b/cpp/src/gandiva/function_registry_timestamp_arithmetic.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/function_registry_timestamp_arithmetic.h" + #include "gandiva/function_registry_common.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_registry_timestamp_arithmetic.h b/cpp/src/gandiva/function_registry_timestamp_arithmetic.h index 9ac3ab2ec1f3e..a1ec3ae8d228b 100644 --- a/cpp/src/gandiva/function_registry_timestamp_arithmetic.h +++ b/cpp/src/gandiva/function_registry_timestamp_arithmetic.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/native_function.h" namespace gandiva { diff --git a/cpp/src/gandiva/function_signature.cc b/cpp/src/gandiva/function_signature.cc index 665973833b6e0..3618d54530e0d 100644 --- a/cpp/src/gandiva/function_signature.cc +++ b/cpp/src/gandiva/function_signature.cc @@ -47,11 +47,10 @@ bool DataTypeEquals(const DataTypePtr& left, const DataTypePtr& right) { } case arrow::Type::TIMESTAMP: { // Signature for timestamp treated the same if both are with zone or without zone. - auto tleft = checked_cast(left.get()); - auto tright = checked_cast(right.get()); - return (tleft != NULL) && (tright != NULL) && - (tleft->unit() == tright->unit()) && - (tleft->timezone().empty() == tleft->timezone().empty()); + auto tleft = checked_cast(left.get()); + auto tright = checked_cast(right.get()); + return (tleft != NULL) && (tright != NULL) && (tleft->unit() == tright->unit()) && + (tleft->timezone().empty() == tleft->timezone().empty()); } default: return left->Equals(right); diff --git a/cpp/src/gandiva/function_signature_test.cc b/cpp/src/gandiva/function_signature_test.cc index 0eb62d4e7bfb9..d2a8d130a6d14 100644 --- a/cpp/src/gandiva/function_signature_test.cc +++ b/cpp/src/gandiva/function_signature_test.cc @@ -17,10 +17,10 @@ #include "gandiva/function_signature.h" -#include - #include +#include + namespace gandiva { class TestFunctionSignature : public ::testing::Test { diff --git a/cpp/src/gandiva/gdv_function_stubs.cc b/cpp/src/gandiva/gdv_function_stubs.cc index 952af2f1e43e9..6d5ba77c464f5 100644 --- a/cpp/src/gandiva/gdv_function_stubs.cc +++ b/cpp/src/gandiva/gdv_function_stubs.cc @@ -38,16 +38,20 @@ extern "C" { -const uint8_t* gdv_fn_get_json_object_utf8_utf8(int64_t ptr, int64_t holder_ptr, const char* data, int data_len, bool in1_valid, - const char* pattern, int pattern_len, bool in2_valid, bool* out_valid, int32_t* out_len) { +const uint8_t* gdv_fn_get_json_object_utf8_utf8(int64_t ptr, int64_t holder_ptr, + const char* data, int data_len, + bool in1_valid, const char* pattern, + int pattern_len, bool in2_valid, + bool* out_valid, int32_t* out_len) { if (!in1_valid || !in2_valid) { *out_valid = false; *out_len = 0; return reinterpret_cast(""); - } + } gandiva::ExecutionContext* context = reinterpret_cast(ptr); gandiva::JsonHolder* holder = reinterpret_cast(holder_ptr); - auto res = (*holder)(context, std::string(data, data_len), std::string(pattern, pattern_len), out_len); + auto res = (*holder)(context, std::string(data, data_len), + std::string(pattern, pattern_len), out_len); if (res == nullptr) { *out_valid = false; *out_len = 0; @@ -354,31 +358,31 @@ CAST_NUMERIC_FROM_STRING(double, arrow::DoubleType, FLOAT8) #undef CAST_NUMERIC_FROM_STRING -#define CAST_NUMERIC_OR_NULL_FROM_STRING(OUT_TYPE, ARROW_TYPE, TYPE_NAME) \ - GANDIVA_EXPORT \ - OUT_TYPE gdv_fn_cast##TYPE_NAME##_or_null_utf8(int64_t context, const char* data, \ - int32_t len, bool in_valid, bool* out_valid) { \ - OUT_TYPE val = 0; \ - *out_valid = true; \ - if (!in_valid) { \ - *out_valid = false; \ - return val; \ - } \ - /* trim leading and trailing spaces */ \ - int32_t trimmed_len; \ - int32_t start = 0, end = len - 1; \ - while (start <= end && data[start] == ' ') { \ - ++start; \ - } \ - while (end >= start && data[end] == ' ') { \ - --end; \ - } \ - trimmed_len = end - start + 1; \ - const char* trimmed_data = data + start; \ - if (!arrow::internal::ParseValue(trimmed_data, trimmed_len, &val)) { \ - *out_valid = false; \ - } \ - return val; \ +#define CAST_NUMERIC_OR_NULL_FROM_STRING(OUT_TYPE, ARROW_TYPE, TYPE_NAME) \ + GANDIVA_EXPORT \ + OUT_TYPE gdv_fn_cast##TYPE_NAME##_or_null_utf8( \ + int64_t context, const char* data, int32_t len, bool in_valid, bool* out_valid) { \ + OUT_TYPE val = 0; \ + *out_valid = true; \ + if (!in_valid) { \ + *out_valid = false; \ + return val; \ + } \ + /* trim leading and trailing spaces */ \ + int32_t trimmed_len; \ + int32_t start = 0, end = len - 1; \ + while (start <= end && data[start] == ' ') { \ + ++start; \ + } \ + while (end >= start && data[end] == ' ') { \ + --end; \ + } \ + trimmed_len = end - start + 1; \ + const char* trimmed_data = data + start; \ + if (!arrow::internal::ParseValue(trimmed_data, trimmed_len, &val)) { \ + *out_valid = false; \ + } \ + return val; \ } CAST_NUMERIC_OR_NULL_FROM_STRING(int32_t, arrow::Int32Type, INT) @@ -504,19 +508,19 @@ void ExportedStubFunctions::AddMappings(Engine* engine) const { reinterpret_cast(gdv_fn_dec_to_string)); // gdv_fn_get_json_object_utf8_utf8 - args = {types->i64_type(), // int64_t ptr - types->i64_type(), // int64_t holder_ptr - types->i8_ptr_type(), // const char* data - types->i32_type(), // int data_len - types->i1_type(), // bool in1_validity - types->i8_ptr_type(), // const char* pattern - types->i32_type(), // int pattern_len - types->i1_type(), // bool in2_validity + args = {types->i64_type(), // int64_t ptr + types->i64_type(), // int64_t holder_ptr + types->i8_ptr_type(), // const char* data + types->i32_type(), // int data_len + types->i1_type(), // bool in1_validity + types->i8_ptr_type(), // const char* pattern + types->i32_type(), // int pattern_len + types->i1_type(), // bool in2_validity types->ptr_type(types->i8_type()), // bool* out_valid - types->i32_ptr_type()}; // int out_len - engine->AddGlobalMappingForFunc("gdv_fn_get_json_object_utf8_utf8", - types->i8_ptr_type() /*return_type*/, args, - reinterpret_cast(gdv_fn_get_json_object_utf8_utf8)); + types->i32_ptr_type()}; // int out_len + engine->AddGlobalMappingForFunc( + "gdv_fn_get_json_object_utf8_utf8", types->i8_ptr_type() /*return_type*/, args, + reinterpret_cast(gdv_fn_get_json_object_utf8_utf8)); // gdv_fn_like_utf8_utf8 args = {types->i64_type(), // int64_t ptr @@ -668,10 +672,10 @@ void ExportedStubFunctions::AddMappings(Engine* engine) const { engine->AddGlobalMappingForFunc("gdv_fn_castINT_utf8", types->i32_type(), args, reinterpret_cast(gdv_fn_castINT_utf8)); - args = {types->i64_type(), // int64_t context_ptr - types->i8_ptr_type(), // const char* data - types->i32_type(), // int32_t lenr - types->i1_type(), // bool in1_validity + args = {types->i64_type(), // int64_t context_ptr + types->i8_ptr_type(), // const char* data + types->i32_type(), // int32_t lenr + types->i1_type(), // bool in1_validity types->ptr_type(types->i8_type())}; // bool* out_valid engine->AddGlobalMappingForFunc("gdv_fn_castINT_or_null_utf8", types->i32_type(), args, @@ -683,15 +687,16 @@ void ExportedStubFunctions::AddMappings(Engine* engine) const { engine->AddGlobalMappingForFunc("gdv_fn_castBIGINT_utf8", types->i64_type(), args, reinterpret_cast(gdv_fn_castBIGINT_utf8)); - - args = {types->i64_type(), // int64_t context_ptr - types->i8_ptr_type(), // const char* data - types->i32_type(), // int32_t lenr - types->i1_type(), // bool in1_validity + + args = {types->i64_type(), // int64_t context_ptr + types->i8_ptr_type(), // const char* data + types->i32_type(), // int32_t lenr + types->i1_type(), // bool in1_validity types->ptr_type(types->i8_type())}; // bool* out_valid - engine->AddGlobalMappingForFunc("gdv_fn_castBIGINT_or_null_utf8", types->i64_type(), args, - reinterpret_cast(gdv_fn_castBIGINT_or_null_utf8)); + engine->AddGlobalMappingForFunc( + "gdv_fn_castBIGINT_or_null_utf8", types->i64_type(), args, + reinterpret_cast(gdv_fn_castBIGINT_or_null_utf8)); args = {types->i64_type(), // int64_t context_ptr types->i8_ptr_type(), // const char* data @@ -700,14 +705,15 @@ void ExportedStubFunctions::AddMappings(Engine* engine) const { engine->AddGlobalMappingForFunc("gdv_fn_castFLOAT4_utf8", types->float_type(), args, reinterpret_cast(gdv_fn_castFLOAT4_utf8)); - args = {types->i64_type(), // int64_t context_ptr - types->i8_ptr_type(), // const char* data - types->i32_type(), // int32_t lenr - types->i1_type(), // bool in1_validity + args = {types->i64_type(), // int64_t context_ptr + types->i8_ptr_type(), // const char* data + types->i32_type(), // int32_t lenr + types->i1_type(), // bool in1_validity types->ptr_type(types->i8_type())}; // bool* out_valid - engine->AddGlobalMappingForFunc("gdv_fn_castFLOAT4_or_null_utf8", types->float_type(), args, - reinterpret_cast(gdv_fn_castFLOAT4_or_null_utf8)); + engine->AddGlobalMappingForFunc( + "gdv_fn_castFLOAT4_or_null_utf8", types->float_type(), args, + reinterpret_cast(gdv_fn_castFLOAT4_or_null_utf8)); args = {types->i64_type(), // int64_t context_ptr types->i8_ptr_type(), // const char* data @@ -715,15 +721,16 @@ void ExportedStubFunctions::AddMappings(Engine* engine) const { engine->AddGlobalMappingForFunc("gdv_fn_castFLOAT8_utf8", types->double_type(), args, reinterpret_cast(gdv_fn_castFLOAT8_utf8)); - - args = {types->i64_type(), // int64_t context_ptr - types->i8_ptr_type(), // const char* data - types->i32_type(), // int32_t lenr - types->i1_type(), // bool in1_validity + + args = {types->i64_type(), // int64_t context_ptr + types->i8_ptr_type(), // const char* data + types->i32_type(), // int32_t lenr + types->i1_type(), // bool in1_validity types->ptr_type(types->i8_type())}; // bool* out_valid - engine->AddGlobalMappingForFunc("gdv_fn_castFLOAT8_or_null_utf8", types->double_type(), args, - reinterpret_cast(gdv_fn_castFLOAT8_or_null_utf8)); + engine->AddGlobalMappingForFunc( + "gdv_fn_castFLOAT8_or_null_utf8", types->double_type(), args, + reinterpret_cast(gdv_fn_castFLOAT8_or_null_utf8)); // gdv_fn_castVARCHAR_int32_int64 args = {types->i64_type(), // int64_t execution_context diff --git a/cpp/src/gandiva/gdv_function_stubs.h b/cpp/src/gandiva/gdv_function_stubs.h index 2a92f25493640..eaa2ce1122c7a 100644 --- a/cpp/src/gandiva/gdv_function_stubs.h +++ b/cpp/src/gandiva/gdv_function_stubs.h @@ -53,9 +53,12 @@ bool gdv_fn_like_utf8_utf8_utf8(int64_t ptr, const char* data, int data_len, bool gdv_fn_ilike_utf8_utf8(int64_t ptr, const char* data, int data_len, const char* pattern, int pattern_len); - -const uint8_t* gdv_fn_get_json_object_utf8_utf8(int64_t ptr, int64_t holder_ptr, const char* data, int data_len, bool in1_valid, - const char* pattern, int pattern_len, bool in2_valid, bool* out_valid, int32_t* out_len); + +const uint8_t* gdv_fn_get_json_object_utf8_utf8(int64_t ptr, int64_t holder_ptr, + const char* data, int data_len, + bool in1_valid, const char* pattern, + int pattern_len, bool in2_valid, + bool* out_valid, int32_t* out_len); int64_t gdv_fn_to_date_utf8_utf8_int32(int64_t context, int64_t ptr, const char* data, int data_len, bool in1_validity, @@ -99,25 +102,29 @@ GANDIVA_EXPORT int32_t gdv_fn_castINT_utf8(int64_t context, const char* data, int32_t data_len); GANDIVA_EXPORT -int32_t gdv_fn_castINT_or_null_utf8(int64_t context, const char* data, int32_t data_len, bool in_valid, bool* out_valid); +int32_t gdv_fn_castINT_or_null_utf8(int64_t context, const char* data, int32_t data_len, + bool in_valid, bool* out_valid); GANDIVA_EXPORT int64_t gdv_fn_castBIGINT_utf8(int64_t context, const char* data, int32_t data_len); GANDIVA_EXPORT -int64_t gdv_fn_castBIGINT_or_null_utf8(int64_t context, const char* data, int32_t data_len, bool in_valid, bool* out_valid); +int64_t gdv_fn_castBIGINT_or_null_utf8(int64_t context, const char* data, + int32_t data_len, bool in_valid, bool* out_valid); GANDIVA_EXPORT float gdv_fn_castFLOAT4_utf8(int64_t context, const char* data, int32_t data_len); GANDIVA_EXPORT -float gdv_fn_castFLOAT4_or_null_utf8(int64_t context, const char* data, int32_t data_len, bool in_valid, bool* out_valid); +float gdv_fn_castFLOAT4_or_null_utf8(int64_t context, const char* data, int32_t data_len, + bool in_valid, bool* out_valid); GANDIVA_EXPORT double gdv_fn_castFLOAT8_utf8(int64_t context, const char* data, int32_t data_len); GANDIVA_EXPORT -double gdv_fn_castFLOAT8_or_null_utf8(int64_t context, const char* data, int32_t data_len, bool in_valid, bool* out_valid); +double gdv_fn_castFLOAT8_or_null_utf8(int64_t context, const char* data, int32_t data_len, + bool in_valid, bool* out_valid); GANDIVA_EXPORT const char* gdv_fn_castVARCHAR_int32_int64(int64_t context, int32_t value, int64_t len, diff --git a/cpp/src/gandiva/hash_utils.cc b/cpp/src/gandiva/hash_utils.cc index 8ebf60a9b8805..af28c73ec901a 100644 --- a/cpp/src/gandiva/hash_utils.cc +++ b/cpp/src/gandiva/hash_utils.cc @@ -16,7 +16,9 @@ // under the License. #include "gandiva/hash_utils.h" + #include + #include "arrow/util/logging.h" #include "gandiva/gdv_function_stubs.h" #include "openssl/evp.h" diff --git a/cpp/src/gandiva/hash_utils.h b/cpp/src/gandiva/hash_utils.h index 483993f300976..d3ce52717bc08 100644 --- a/cpp/src/gandiva/hash_utils.h +++ b/cpp/src/gandiva/hash_utils.h @@ -20,6 +20,7 @@ #include #include + #include "gandiva/visibility.h" #include "openssl/evp.h" diff --git a/cpp/src/gandiva/hash_utils_test.cc b/cpp/src/gandiva/hash_utils_test.cc index a8f55e1ede7f7..3649db7643925 100644 --- a/cpp/src/gandiva/hash_utils_test.cc +++ b/cpp/src/gandiva/hash_utils_test.cc @@ -15,11 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/hash_utils.h" + #include + #include #include "gandiva/execution_context.h" -#include "gandiva/hash_utils.h" TEST(TestShaHashUtils, TestSha1Numeric) { gandiva::ExecutionContext ctx; diff --git a/cpp/src/gandiva/jni/expression_registry_helper.cc b/cpp/src/gandiva/jni/expression_registry_helper.cc index 0d1f74ba6f01a..056c29d636a90 100644 --- a/cpp/src/gandiva/jni/expression_registry_helper.cc +++ b/cpp/src/gandiva/jni/expression_registry_helper.cc @@ -15,14 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include "jni/org_apache_arrow_gandiva_evaluator_ExpressionRegistryJniHelper.h" - #include #include "Types.pb.h" #include "arrow/util/logging.h" #include "gandiva/arrow.h" #include "gandiva/expression_registry.h" +#include "jni/org_apache_arrow_gandiva_evaluator_ExpressionRegistryJniHelper.h" using gandiva::DataTypePtr; using gandiva::ExpressionRegistry; diff --git a/cpp/src/gandiva/jni/jni_common.cc b/cpp/src/gandiva/jni/jni_common.cc index e17eac7eab438..cb2abbfa9e216 100644 --- a/cpp/src/gandiva/jni/jni_common.cc +++ b/cpp/src/gandiva/jni/jni_common.cc @@ -15,6 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include +#include +#include #include #include @@ -25,10 +28,6 @@ #include #include -#include -#include -#include - #include "Types.pb.h" #include "gandiva/configuration.h" #include "gandiva/decimal_scalar.h" diff --git a/cpp/src/gandiva/json_holder.cc b/cpp/src/gandiva/json_holder.cc index 9e0263786e3d6..1f85badc8fe5a 100644 --- a/cpp/src/gandiva/json_holder.cc +++ b/cpp/src/gandiva/json_holder.cc @@ -33,14 +33,16 @@ Status JsonHolder::Make(std::shared_ptr* holder) { return Status::OK(); } -const uint8_t* JsonHolder::operator()(gandiva::ExecutionContext* ctx, const std::string& json_str, const std::string& json_path, int32_t* out_len) { +const uint8_t* JsonHolder::operator()(gandiva::ExecutionContext* ctx, + const std::string& json_str, + const std::string& json_path, int32_t* out_len) { std::unique_ptr parser; (arrow::json::BlockParser::Make(parse_options_, &parser)); (parser->Parse(std::make_shared(json_str))); std::shared_ptr parsed; (parser->Finish(&parsed)); auto struct_parsed = std::dynamic_pointer_cast(parsed); - //json_path example: $.col_14, will extract col_14 here + // json_path example: $.col_14, will extract col_14 here if (json_path.length() < 3) { return nullptr; } diff --git a/cpp/src/gandiva/json_holder.h b/cpp/src/gandiva/json_holder.h index 0ca4765505083..90b0c6e639678 100644 --- a/cpp/src/gandiva/json_holder.h +++ b/cpp/src/gandiva/json_holder.h @@ -39,9 +39,10 @@ class GANDIVA_EXPORT JsonHolder : public FunctionHolder { static Status Make(const FunctionNode& node, std::shared_ptr* holder); static Status Make(std::shared_ptr* holder); - //TODO(): should try to return const uint8_t * - const uint8_t* operator()(ExecutionContext* ctx, const std::string& json_str, const std::string& json_path, int32_t* out_len); - + // TODO(): should try to return const uint8_t * + const uint8_t* operator()(ExecutionContext* ctx, const std::string& json_str, + const std::string& json_path, int32_t* out_len); + arrow::json::ParseOptions parse_options_ = arrow::json::ParseOptions::Defaults(); arrow::json::ReadOptions read_options_ = arrow::json::ReadOptions::Defaults(); }; diff --git a/cpp/src/gandiva/json_holder_test.cc b/cpp/src/gandiva/json_holder_test.cc index 60f60b941dc04..d7a94ece15104 100644 --- a/cpp/src/gandiva/json_holder_test.cc +++ b/cpp/src/gandiva/json_holder_test.cc @@ -41,14 +41,15 @@ TEST_F(TestJsonHolder, TestJson) { int32_t out_len; - const uint8_t* data = get_json_object(&execution_context_, R"({"hello": "3.5"})", "$.hello", &out_len); + const uint8_t* data = + get_json_object(&execution_context_, R"({"hello": "3.5"})", "$.hello", &out_len); EXPECT_EQ(std::string((char*)data, out_len), "3.5"); // test the case that value is not surrended by double quotes. data = get_json_object(&execution_context_, R"({"hello": 3.5})", "$.hello", &out_len); EXPECT_EQ(out_len, 3); EXPECT_EQ(std::string((char*)data, out_len), "3.5"); - + // no data contained for given field. data = get_json_object(&execution_context_, R"({"hello": 3.5})", "$.hi", &out_len); EXPECT_EQ(data, nullptr); @@ -61,7 +62,7 @@ TEST_F(TestJsonHolder, TestJson) { // illegal json string. data = get_json_object(&execution_context_, R"({"hello"-3.5})", "$.hello", &out_len); EXPECT_EQ(data, nullptr); - + // field name is incorrectly given. data = get_json_object(&execution_context_, R"({"hello": 3.5})", "$hello", &out_len); EXPECT_EQ(data, nullptr); @@ -69,12 +70,15 @@ TEST_F(TestJsonHolder, TestJson) { // field name is not given. data = get_json_object(&execution_context_, R"({"hello": 3.5})", "$.", &out_len); EXPECT_EQ(data, nullptr); - - data = get_json_object(&execution_context_, R"({"name": "fang", "age": 5, "id": "001"})", "$.age", &out_len); + + data = get_json_object(&execution_context_, + R"({"name": "fang", "age": 5, "id": "001"})", "$.age", &out_len); EXPECT_EQ(out_len, 1); EXPECT_EQ(std::string((char*)data, out_len), "5"); - data = get_json_object(&execution_context_, R"({"name": "fang", "age": "5", "id": "001"})", "$.id", &out_len); + data = + get_json_object(&execution_context_, R"({"name": "fang", "age": "5", "id": "001"})", + "$.id", &out_len); EXPECT_EQ(out_len, 3); EXPECT_EQ(std::string((char*)data, out_len), "001"); } diff --git a/cpp/src/gandiva/like_holder.cc b/cpp/src/gandiva/like_holder.cc index af9ac67d66ac4..42a71c9fa1cd0 100644 --- a/cpp/src/gandiva/like_holder.cc +++ b/cpp/src/gandiva/like_holder.cc @@ -18,6 +18,7 @@ #include "gandiva/like_holder.h" #include + #include "gandiva/node.h" #include "gandiva/regex_util.h" diff --git a/cpp/src/gandiva/like_holder.h b/cpp/src/gandiva/like_holder.h index 73e58017de19f..982e5d271f942 100644 --- a/cpp/src/gandiva/like_holder.h +++ b/cpp/src/gandiva/like_holder.h @@ -17,13 +17,12 @@ #pragma once +#include + #include #include -#include - #include "arrow/status.h" - #include "gandiva/function_holder.h" #include "gandiva/node.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/like_holder_test.cc b/cpp/src/gandiva/like_holder_test.cc index a52533a113836..33871477177fb 100644 --- a/cpp/src/gandiva/like_holder_test.cc +++ b/cpp/src/gandiva/like_holder_test.cc @@ -16,12 +16,13 @@ // under the License. #include "gandiva/like_holder.h" -#include "gandiva/regex_util.h" + +#include #include #include -#include +#include "gandiva/regex_util.h" namespace gandiva { diff --git a/cpp/src/gandiva/literal_holder.cc b/cpp/src/gandiva/literal_holder.cc index beed8119cb1cb..9805cca5e1619 100644 --- a/cpp/src/gandiva/literal_holder.cc +++ b/cpp/src/gandiva/literal_holder.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include - #include "gandiva/literal_holder.h" +#include + namespace gandiva { namespace { diff --git a/cpp/src/gandiva/literal_holder.h b/cpp/src/gandiva/literal_holder.h index c4712aafc4bbd..2f3b08a7e3ca3 100644 --- a/cpp/src/gandiva/literal_holder.h +++ b/cpp/src/gandiva/literal_holder.h @@ -17,11 +17,11 @@ #pragma once -#include - +#include #include -#include +#include + #include "gandiva/decimal_scalar.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/llvm_generator.h b/cpp/src/gandiva/llvm_generator.h index 8ff9711c0f91a..6830b0fa2eae6 100644 --- a/cpp/src/gandiva/llvm_generator.h +++ b/cpp/src/gandiva/llvm_generator.h @@ -23,7 +23,6 @@ #include #include "arrow/util/macros.h" - #include "gandiva/annotator.h" #include "gandiva/compiled_expr.h" #include "gandiva/configuration.h" diff --git a/cpp/src/gandiva/llvm_generator_test.cc b/cpp/src/gandiva/llvm_generator_test.cc index bdc3b0051691f..344be7ed2257d 100644 --- a/cpp/src/gandiva/llvm_generator_test.cc +++ b/cpp/src/gandiva/llvm_generator_test.cc @@ -17,11 +17,12 @@ #include "gandiva/llvm_generator.h" +#include +#include + #include #include -#include -#include #include "gandiva/configuration.h" #include "gandiva/dex.h" #include "gandiva/expression.h" diff --git a/cpp/src/gandiva/local_bitmaps_holder.h b/cpp/src/gandiva/local_bitmaps_holder.h index a172fb973c4a5..7668d6b66b70a 100644 --- a/cpp/src/gandiva/local_bitmaps_holder.h +++ b/cpp/src/gandiva/local_bitmaps_holder.h @@ -17,11 +17,12 @@ #pragma once +#include + #include #include #include -#include #include "gandiva/arrow.h" #include "gandiva/gandiva_aliases.h" diff --git a/cpp/src/gandiva/lru_cache_test.cc b/cpp/src/gandiva/lru_cache_test.cc index 06c86d6903249..2559d88ae1d4d 100644 --- a/cpp/src/gandiva/lru_cache_test.cc +++ b/cpp/src/gandiva/lru_cache_test.cc @@ -17,12 +17,12 @@ #include "gandiva/lru_cache.h" +#include + #include #include #include -#include - namespace gandiva { class TestCacheKey { diff --git a/cpp/src/gandiva/lvalue.h b/cpp/src/gandiva/lvalue.h index df292855b69af..28d03f0f2c986 100644 --- a/cpp/src/gandiva/lvalue.h +++ b/cpp/src/gandiva/lvalue.h @@ -19,9 +19,8 @@ #include -#include "arrow/util/macros.h" - #include "arrow/util/logging.h" +#include "arrow/util/macros.h" #include "gandiva/llvm_includes.h" namespace gandiva { diff --git a/cpp/src/gandiva/node.h b/cpp/src/gandiva/node.h index 20807d4a0cb5b..7699da17841c7 100644 --- a/cpp/src/gandiva/node.h +++ b/cpp/src/gandiva/node.h @@ -23,7 +23,6 @@ #include #include "arrow/status.h" - #include "gandiva/arrow.h" #include "gandiva/func_descriptor.h" #include "gandiva/gandiva_aliases.h" diff --git a/cpp/src/gandiva/node_visitor.h b/cpp/src/gandiva/node_visitor.h index b118e49638393..fa5f19de1f07a 100644 --- a/cpp/src/gandiva/node_visitor.h +++ b/cpp/src/gandiva/node_visitor.h @@ -20,7 +20,6 @@ #include #include "arrow/status.h" - #include "arrow/util/logging.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/precompiled/arithmetic_ops.cc b/cpp/src/gandiva/precompiled/arithmetic_ops.cc index 7d7eed6defc85..f1b49493d4a41 100644 --- a/cpp/src/gandiva/precompiled/arithmetic_ops.cc +++ b/cpp/src/gandiva/precompiled/arithmetic_ops.cc @@ -20,7 +20,9 @@ extern "C" { #include #include #include + #include + #include "./types.h" // Expand inner macro for all numeric types. @@ -41,7 +43,7 @@ extern "C" { INNER(NAME, date64, OP) \ INNER(NAME, date32, OP) \ INNER(NAME, timestamp, OP) \ - INNER(NAME, timestampusutc, OP) \ + INNER(NAME, timestampusutc, OP) \ INNER(NAME, time32, OP) #define NUMERIC_DATE_TYPES(INNER, NAME, OP) \ @@ -115,20 +117,20 @@ NUMERIC_DATE_TYPES(BINARY_RELATIONAL, greater_than_or_equal_to, >=) #undef BINARY_RELATIONAL // Relational binary fns : left, right params are same, return is bool. -#define BINARY_RELATIONAL_NAN(NAME, TYPE, OP) \ - FORCE_INLINE \ - bool NAME##_##TYPE##_##TYPE(gdv_##TYPE left, gdv_##TYPE right) { \ - const double infinity = 1.0 / 0.0; \ - bool left_is_nan = isnan(left); \ - bool right_is_nan = isnan(right); \ - if (left_is_nan && right_is_nan) { \ - return infinity OP infinity; \ - } else if (left_is_nan) { \ - return infinity OP right; \ - } else if (right_is_nan) { \ - return left OP infinity; \ - } \ - return left OP right; \ +#define BINARY_RELATIONAL_NAN(NAME, TYPE, OP) \ + FORCE_INLINE \ + bool NAME##_##TYPE##_##TYPE(gdv_##TYPE left, gdv_##TYPE right) { \ + const double infinity = 1.0 / 0.0; \ + bool left_is_nan = isnan(left); \ + bool right_is_nan = isnan(right); \ + if (left_is_nan && right_is_nan) { \ + return infinity OP infinity; \ + } else if (left_is_nan) { \ + return infinity OP right; \ + } else if (right_is_nan) { \ + return left OP infinity; \ + } \ + return left OP right; \ } NUMERIC_BOOL_DATE_TYPES(BINARY_RELATIONAL_NAN, equal_with_nan, ==) @@ -141,16 +143,16 @@ NUMERIC_DATE_TYPES(BINARY_RELATIONAL_NAN, greater_than_or_equal_to_with_nan, >=) #undef BINARY_RELATIONAL_NAN // normalize -#define NORMALIZE(IN_TYPE, OUT_TYPE) \ - FORCE_INLINE \ - gdv_##OUT_TYPE normalize_##IN_TYPE(gdv_##IN_TYPE in) { \ - if (isnan(in)) { \ - return 0.0 / 0.0; \ - } else if (std::abs(in) < 0.0000001) { \ - return 0.0; \ - } else { \ - return in; \ - } \ +#define NORMALIZE(IN_TYPE, OUT_TYPE) \ + FORCE_INLINE \ + gdv_##OUT_TYPE normalize_##IN_TYPE(gdv_##IN_TYPE in) { \ + if (isnan(in)) { \ + return 0.0 / 0.0; \ + } else if (std::abs(in) < 0.0000001) { \ + return 0.0; \ + } else { \ + return in; \ + } \ } NORMALIZE(float64, float64) @@ -221,11 +223,11 @@ CAST_UNARY_UTF8(castVARCHAR, int8, utf8, "%d", NOFMT, nothing) CAST_UNARY_UTF8(castVARCHAR, int16, utf8, "%d", NOFMT, nothing) CAST_UNARY_UTF8(castVARCHAR, int32, utf8, "%d", NOFMT, nothing) CAST_UNARY_UTF8(castVARCHAR, int64, utf8, "%ld", NOFMT, nothing) -// We set to display the full precision of Float/Double, but this may still behave +// We set to display the full precision of Float/Double, but this may still behave // differently with vanilla spark. CAST_UNARY_UTF8(castVARCHAR, float32, utf8, "%.*f", FMT, FLT_DIG) CAST_UNARY_UTF8(castVARCHAR, float64, utf8, "%.*f", FMT, DBL_DIG) -// %g means converting floating-point number depending on the value and the precision. +// %g means converting floating-point number depending on the value and the precision. // It bahaves similar to the shortest representation. // CAST_UNARY_UTF8(castVARCHAR, float32, utf8, "%g", NOFMT, nothing) // CAST_UNARY_UTF8(castVARCHAR, float64, utf8, "%g", NOFMT, nothing) @@ -357,10 +359,10 @@ BITWISE_NOT(int32) BITWISE_NOT(int64) #undef BITWISE_NOT -#define SHIFT_LEFT_INT(LTYPE, RTYPE) \ - FORCE_INLINE \ - gdv_##LTYPE shift_left_##LTYPE##_##RTYPE(gdv_##LTYPE in1, gdv_##RTYPE in2) { \ - return static_cast(in1 << in2); \ +#define SHIFT_LEFT_INT(LTYPE, RTYPE) \ + FORCE_INLINE \ + gdv_##LTYPE shift_left_##LTYPE##_##RTYPE(gdv_##LTYPE in1, gdv_##RTYPE in2) { \ + return static_cast(in1 << in2); \ } SHIFT_LEFT_INT(int32, int32) diff --git a/cpp/src/gandiva/precompiled/arithmetic_ops_test.cc b/cpp/src/gandiva/precompiled/arithmetic_ops_test.cc index f5700942a973b..5d563013c0d78 100644 --- a/cpp/src/gandiva/precompiled/arithmetic_ops_test.cc +++ b/cpp/src/gandiva/precompiled/arithmetic_ops_test.cc @@ -17,6 +17,7 @@ #include #include + #include "../execution_context.h" #include "gandiva/precompiled/types.h" diff --git a/cpp/src/gandiva/precompiled/bitmap_test.cc b/cpp/src/gandiva/precompiled/bitmap_test.cc index ac3084ade6b12..286b535415a3f 100644 --- a/cpp/src/gandiva/precompiled/bitmap_test.cc +++ b/cpp/src/gandiva/precompiled/bitmap_test.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "gandiva/precompiled/types.h" namespace gandiva { diff --git a/cpp/src/gandiva/precompiled/decimal_ops.h b/cpp/src/gandiva/precompiled/decimal_ops.h index 292dce2208ca6..c8c6b6c60c4f2 100644 --- a/cpp/src/gandiva/precompiled/decimal_ops.h +++ b/cpp/src/gandiva/precompiled/decimal_ops.h @@ -19,6 +19,7 @@ #include #include + #include "gandiva/basic_decimal_scalar.h" namespace gandiva { diff --git a/cpp/src/gandiva/precompiled/decimal_ops_test.cc b/cpp/src/gandiva/precompiled/decimal_ops_test.cc index be8a1fe8ade40..e1fa0100f653b 100644 --- a/cpp/src/gandiva/precompiled/decimal_ops_test.cc +++ b/cpp/src/gandiva/precompiled/decimal_ops_test.cc @@ -15,7 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/precompiled/decimal_ops.h" + #include + #include #include #include @@ -26,7 +29,6 @@ #include "gandiva/decimal_scalar.h" #include "gandiva/decimal_type_util.h" #include "gandiva/execution_context.h" -#include "gandiva/precompiled/decimal_ops.h" #include "gandiva/precompiled/types.h" namespace gandiva { diff --git a/cpp/src/gandiva/precompiled/epoch_time_point_test.cc b/cpp/src/gandiva/precompiled/epoch_time_point_test.cc index 9180aac07634c..3ce1b6863ad6c 100644 --- a/cpp/src/gandiva/precompiled/epoch_time_point_test.cc +++ b/cpp/src/gandiva/precompiled/epoch_time_point_test.cc @@ -15,14 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include +#include "./epoch_time_point.h" #include -#include "./epoch_time_point.h" -#include "gandiva/precompiled/testing.h" -#include "gandiva/precompiled/types.h" + +#include #include "gandiva/date_utils.h" +#include "gandiva/precompiled/testing.h" +#include "gandiva/precompiled/types.h" namespace gandiva { diff --git a/cpp/src/gandiva/precompiled/extended_math_ops.cc b/cpp/src/gandiva/precompiled/extended_math_ops.cc index 7ef542201d182..0412aa2a79f66 100644 --- a/cpp/src/gandiva/precompiled/extended_math_ops.cc +++ b/cpp/src/gandiva/precompiled/extended_math_ops.cc @@ -28,6 +28,7 @@ extern "C" { #include #include #include + #include "./types.h" // Expand the inner fn for types that support extended math. diff --git a/cpp/src/gandiva/precompiled/extended_math_ops_test.cc b/cpp/src/gandiva/precompiled/extended_math_ops_test.cc index 6e59f684f6214..4766cc9c7e326 100644 --- a/cpp/src/gandiva/precompiled/extended_math_ops_test.cc +++ b/cpp/src/gandiva/precompiled/extended_math_ops_test.cc @@ -20,7 +20,9 @@ #endif #include + #include + #include "gandiva/execution_context.h" #include "gandiva/precompiled/types.h" diff --git a/cpp/src/gandiva/precompiled/hash_test.cc b/cpp/src/gandiva/precompiled/hash_test.cc index 0a51dced2bdf5..ecc72580ad9c7 100644 --- a/cpp/src/gandiva/precompiled/hash_test.cc +++ b/cpp/src/gandiva/precompiled/hash_test.cc @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. +#include #include -#include #include "gandiva/precompiled/types.h" namespace gandiva { diff --git a/cpp/src/gandiva/precompiled/testing.h b/cpp/src/gandiva/precompiled/testing.h index c41bc54714831..6cd407f8ca6c4 100644 --- a/cpp/src/gandiva/precompiled/testing.h +++ b/cpp/src/gandiva/precompiled/testing.h @@ -17,14 +17,13 @@ #pragma once +#include + #include #include -#include - #include "arrow/util/logging.h" #include "arrow/util/value_parsing.h" - #include "gandiva/date_utils.h" #include "gandiva/precompiled/types.h" diff --git a/cpp/src/gandiva/precompiled/time.cc b/cpp/src/gandiva/precompiled/time.cc index beea0534756af..7874ab5a5100e 100644 --- a/cpp/src/gandiva/precompiled/time.cc +++ b/cpp/src/gandiva/precompiled/time.cc @@ -609,8 +609,9 @@ gdv_date64 castDATE_utf8(int64_t context, const char* input, gdv_int32 length) { .count(); } -// This function Will set result to be null if input is invalid, instead of throwing error. -gdv_date64 castDATE_nullsafe_utf8(int64_t context, const char* input, gdv_int32 length, +// This function Will set result to be null if input is invalid, instead of throwing +// error. +gdv_date64 castDATE_nullsafe_utf8(int64_t context, const char* input, gdv_int32 length, bool in_valid, bool* out_valid) { if (!in_valid) { *out_valid = false; @@ -689,13 +690,13 @@ const char* castVARCHAR_date32_int64(gdv_int64 context, gdv_date32 in_day, if (length == 10) { // yyyy-MM-dd res = snprintf(char_buffer, char_buffer_length, - "%04" PRId64 "-%02" PRId64 "-%02" PRId64, year, month, day); + "%04" PRId64 "-%02" PRId64 "-%02" PRId64, year, month, day); } else if (length == 8) { // yyyyMMdd res = snprintf(char_buffer, char_buffer_length, - "%04" PRId64 "%02" PRId64 "%02" PRId64, year, month, day); + "%04" PRId64 "%02" PRId64 "%02" PRId64, year, month, day); } - + if (res < 0) { gdv_fn_context_set_error_msg(context, "Could not format the date"); return ""; @@ -874,7 +875,6 @@ gdv_timestamp castTIMESTAMP_with_validation_check_utf8(int64_t context, const ch return castTIMESTAMP_withCarrying_utf8(context, input, length, in_valid, out_valid); } - /* * Input consists of mandatory and optional fields. * Mandatory fields are year, month and day. @@ -1113,9 +1113,7 @@ gdv_int64 extractMillis_daytimeinterval(gdv_day_time_interval in) { } FORCE_INLINE -gdv_int64 castBIGINT_timestamp(gdv_timestamp in) { - return in; -} +gdv_int64 castBIGINT_timestamp(gdv_timestamp in) { return in; } FORCE_INLINE gdv_int64 castBIGINT_daytimeinterval(gdv_day_time_interval in) { @@ -1124,9 +1122,7 @@ gdv_int64 castBIGINT_daytimeinterval(gdv_day_time_interval in) { } FORCE_INLINE -gdv_int32 unix_date_date32(gdv_date32 in) { - return in; -} +gdv_int32 unix_date_date32(gdv_date32 in) { return in; } FORCE_INLINE gdv_int64 unix_date_seconds_date32(gdv_date32 in) { @@ -1135,49 +1131,31 @@ gdv_int64 unix_date_seconds_date32(gdv_date32 in) { } FORCE_INLINE -gdv_int64 unix_seconds_timestampusutc(gdv_timestamp in) { - return in / 1000000; -} +gdv_int64 unix_seconds_timestampusutc(gdv_timestamp in) { return in / 1000000; } FORCE_INLINE -gdv_int64 unix_millis_timestampusutc(gdv_timestamp in) { - return in / 1000; -} +gdv_int64 unix_millis_timestampusutc(gdv_timestamp in) { return in / 1000; } FORCE_INLINE -gdv_int64 unix_micros_timestampusutc(gdv_timestamp in) { - return in; -} +gdv_int64 unix_micros_timestampusutc(gdv_timestamp in) { return in; } FORCE_INLINE -gdv_timestamp seconds_to_timestamp_int64(gdv_int64 in) { - return in * 1000000; -} +gdv_timestamp seconds_to_timestamp_int64(gdv_int64 in) { return in * 1000000; } FORCE_INLINE -gdv_timestamp seconds_to_timestamp_int32(gdv_int32 in) { - return (int64_t)in * 1000000; -} +gdv_timestamp seconds_to_timestamp_int32(gdv_int32 in) { return (int64_t)in * 1000000; } FORCE_INLINE -gdv_timestamp millis_to_timestamp_int64(gdv_int64 in) { - return in * 1000; -} +gdv_timestamp millis_to_timestamp_int64(gdv_int64 in) { return in * 1000; } FORCE_INLINE -gdv_timestamp millis_to_timestamp_int32(gdv_int32 in) { - return (int64_t)in * 1000; -} +gdv_timestamp millis_to_timestamp_int32(gdv_int32 in) { return (int64_t)in * 1000; } FORCE_INLINE -gdv_timestamp micros_to_timestamp_int64(gdv_int64 in) { - return in; -} +gdv_timestamp micros_to_timestamp_int64(gdv_int64 in) { return in; } FORCE_INLINE -gdv_timestamp micros_to_timestamp_int32(gdv_int32 in) { - return (int64_t)in; -} +gdv_timestamp micros_to_timestamp_int32(gdv_int32 in) { return (int64_t)in; } FORCE_INLINE gdv_int32 micros_to_timestamp_date32_date32(gdv_date32 left, gdv_date32 right) { diff --git a/cpp/src/gandiva/precompiled/time_test.cc b/cpp/src/gandiva/precompiled/time_test.cc index 689a88e6f61e2..79dad4b6463a7 100644 --- a/cpp/src/gandiva/precompiled/time_test.cc +++ b/cpp/src/gandiva/precompiled/time_test.cc @@ -741,7 +741,7 @@ TEST(TestTime, TestLastDay) { ts = StringToTimestamp("2015-12-03 03:12:59"); out = last_day_from_timestamp(ts); EXPECT_EQ(StringToTimestamp("2015-12-31 00:00:00"), out); - } +} TEST(TestTime, castVarcharDate) { ExecutionContext context; @@ -755,7 +755,7 @@ TEST(TestTime, castVarcharDate) { // Test yyyyMMdd format out = castVARCHAR_date32_int64(context_ptr, date32, 8L, &out_len); EXPECT_EQ(std::string(out, out_len), "20201201"); - + // Test date before unix epoch date64 = castDATE_utf8(context_ptr, "1967-12-1", 9); date32 = castDATE32_date64(date64); diff --git a/cpp/src/gandiva/precompiled/timestamp_arithmetic.cc b/cpp/src/gandiva/precompiled/timestamp_arithmetic.cc index 088bbe5e9c4b0..cbf05b91756c1 100644 --- a/cpp/src/gandiva/precompiled/timestamp_arithmetic.cc +++ b/cpp/src/gandiva/precompiled/timestamp_arithmetic.cc @@ -50,6 +50,7 @@ bool is_last_day_of_month(const EpochTimePoint& tp) { extern "C" { #include + #include "./time_constants.h" #include "./types.h" @@ -166,10 +167,10 @@ TIMESTAMP_DIFF(timestamp) return millis + TO_MILLIS * static_cast(count); \ } -#define ADD_DATE32_TO_INT32_FIXED_UNITS(TYPE, NAME, TO_DAYS) \ - FORCE_INLINE \ - gdv_##TYPE NAME##_##TYPE##_int32(gdv_##TYPE days, gdv_int32 count) { \ - return days + TO_DAYS * static_cast(count); \ +#define ADD_DATE32_TO_INT32_FIXED_UNITS(TYPE, NAME, TO_DAYS) \ + FORCE_INLINE \ + gdv_##TYPE NAME##_##TYPE##_int32(gdv_##TYPE days, gdv_int32 count) { \ + return days + TO_DAYS * static_cast(count); \ } #define ADD_TIMESTAMP_TO_INT64_FIXED_UNITS(TYPE, NAME, TO_MILLIS) \ diff --git a/cpp/src/gandiva/precompiled/types.h b/cpp/src/gandiva/precompiled/types.h index 77e662ac10429..d890aebfbfa0c 100644 --- a/cpp/src/gandiva/precompiled/types.h +++ b/cpp/src/gandiva/precompiled/types.h @@ -18,6 +18,7 @@ #pragma once #include + #include "gandiva/gdv_function_stubs.h" // Use the same names as in arrow data types. Makes it easy to write pre-processor macros. @@ -280,8 +281,8 @@ gdv_timestamp castTIMESTAMP_withCarrying_utf8(int64_t context, const char* input gdv_int32 length, bool in_valid, bool* out_valid); gdv_timestamp castTIMESTAMP_with_validation_check_utf8(int64_t context, const char* input, - gdv_int32 length, bool in_valid, - bool* out_valid); + gdv_int32 length, bool in_valid, + bool* out_valid); gdv_timestamp castTIMESTAMP_date64(gdv_date64); gdv_timestamp castTIMESTAMP_int64(gdv_int64); gdv_date64 castDATE_timestamp(gdv_timestamp); diff --git a/cpp/src/gandiva/projector.cc b/cpp/src/gandiva/projector.cc index 734720c64c9ad..d58c33447882e 100644 --- a/cpp/src/gandiva/projector.cc +++ b/cpp/src/gandiva/projector.cc @@ -24,7 +24,6 @@ #include "arrow/util/hash_util.h" #include "arrow/util/logging.h" - #include "gandiva/cache.h" #include "gandiva/expr_validator.h" #include "gandiva/llvm_generator.h" diff --git a/cpp/src/gandiva/projector.h b/cpp/src/gandiva/projector.h index 20b36c9d883cd..0d3cae6e3fdfc 100644 --- a/cpp/src/gandiva/projector.h +++ b/cpp/src/gandiva/projector.h @@ -23,7 +23,6 @@ #include #include "arrow/status.h" - #include "gandiva/arrow.h" #include "gandiva/configuration.h" #include "gandiva/expression.h" diff --git a/cpp/src/gandiva/random_generator_holder.cc b/cpp/src/gandiva/random_generator_holder.cc index 3471c87d92b89..8710c73705283 100644 --- a/cpp/src/gandiva/random_generator_holder.cc +++ b/cpp/src/gandiva/random_generator_holder.cc @@ -16,6 +16,7 @@ // under the License. #include "gandiva/random_generator_holder.h" + #include "gandiva/node.h" namespace gandiva { diff --git a/cpp/src/gandiva/random_generator_holder.h b/cpp/src/gandiva/random_generator_holder.h index 65b6607e87840..ce8b8ca78e267 100644 --- a/cpp/src/gandiva/random_generator_holder.h +++ b/cpp/src/gandiva/random_generator_holder.h @@ -22,7 +22,6 @@ #include "arrow/status.h" #include "arrow/util/io_util.h" - #include "gandiva/function_holder.h" #include "gandiva/node.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/random_generator_holder_test.cc b/cpp/src/gandiva/random_generator_holder_test.cc index 4b16c1b7d0d9a..a06d4c04633d6 100644 --- a/cpp/src/gandiva/random_generator_holder_test.cc +++ b/cpp/src/gandiva/random_generator_holder_test.cc @@ -17,10 +17,10 @@ #include "gandiva/random_generator_holder.h" -#include - #include +#include + namespace gandiva { class TestRandGenHolder : public ::testing::Test { diff --git a/cpp/src/gandiva/selection_vector.cc b/cpp/src/gandiva/selection_vector.cc index a30bba6864e98..1078b5027a683 100644 --- a/cpp/src/gandiva/selection_vector.cc +++ b/cpp/src/gandiva/selection_vector.cc @@ -24,7 +24,6 @@ #include "arrow/util/bit_util.h" #include "arrow/util/endian.h" - #include "gandiva/selection_vector_impl.h" namespace gandiva { diff --git a/cpp/src/gandiva/selection_vector.h b/cpp/src/gandiva/selection_vector.h index 1c0fef1c59485..05bbe62304df6 100644 --- a/cpp/src/gandiva/selection_vector.h +++ b/cpp/src/gandiva/selection_vector.h @@ -20,7 +20,6 @@ #include #include "arrow/status.h" - #include "arrow/util/logging.h" #include "gandiva/arrow.h" #include "gandiva/visibility.h" diff --git a/cpp/src/gandiva/selection_vector_impl.h b/cpp/src/gandiva/selection_vector_impl.h index dc9724ca86fe2..92f336cee92dd 100644 --- a/cpp/src/gandiva/selection_vector_impl.h +++ b/cpp/src/gandiva/selection_vector_impl.h @@ -21,9 +21,8 @@ #include #include "arrow/status.h" -#include "arrow/util/macros.h" - #include "arrow/util/logging.h" +#include "arrow/util/macros.h" #include "gandiva/arrow.h" #include "gandiva/selection_vector.h" diff --git a/cpp/src/gandiva/selection_vector_test.cc b/cpp/src/gandiva/selection_vector_test.cc index 6868929018d72..5e7f884b491b9 100644 --- a/cpp/src/gandiva/selection_vector_test.cc +++ b/cpp/src/gandiva/selection_vector_test.cc @@ -17,12 +17,12 @@ #include "gandiva/selection_vector.h" +#include + #include #include #include -#include - #include "arrow/testing/gtest_util.h" namespace gandiva { diff --git a/cpp/src/gandiva/tests/binary_test.cc b/cpp/src/gandiva/tests/binary_test.cc index 6ac3c5155196e..3bb5a2c6da5a7 100644 --- a/cpp/src/gandiva/tests/binary_test.cc +++ b/cpp/src/gandiva/tests/binary_test.cc @@ -16,9 +16,9 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/boolean_expr_test.cc b/cpp/src/gandiva/tests/boolean_expr_test.cc index 9226f357159c6..c97f8073bd106 100644 --- a/cpp/src/gandiva/tests/boolean_expr_test.cc +++ b/cpp/src/gandiva/tests/boolean_expr_test.cc @@ -16,9 +16,9 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/date_time_test.cc b/cpp/src/gandiva/tests/date_time_test.cc index 79c053441bf3c..d5642016a5278 100644 --- a/cpp/src/gandiva/tests/date_time_test.cc +++ b/cpp/src/gandiva/tests/date_time_test.cc @@ -19,6 +19,7 @@ #include #include #include + #include "arrow/memory_pool.h" #include "gandiva/precompiled/time_constants.h" #include "gandiva/projector.h" @@ -589,47 +590,47 @@ TEST_F(TestProjector, TestLastDay) { } TEST_F(TestProjector, TestCastToUTF8) { -// schema for input fields -auto field_date32 = field("f_date32", arrow::date32()); -auto node_date32 = TreeExprBuilder::MakeField(field_date32); -auto schema = arrow::schema({field_date32}); - -// output fields -auto field_0 = field("date32_str", arrow::utf8()); - -// Build expression -auto int64_literal = TreeExprBuilder::MakeLiteral(10L); -auto func0 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_date32, int64_literal}, - arrow::utf8()); -auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); -std::shared_ptr projector; -auto status = Projector::Make(schema, {expr0}, TestConfiguration(), &projector); -EXPECT_TRUE(status.ok()) << status.message(); - -// Create a row-batch with some sample data -int num_records = 4; -time_t epoch = Epoch(); -auto validity = {true, true, true, true}; -std::vector field0_data = {DaysSince(epoch, 2000, 1, 1, 5, 0, 0, 0), - DaysSince(epoch, 1999, 12, 31, 5, 0, 0, 0), - DaysSince(epoch, 2015, 6, 30, 20, 0, 0, 0), - DaysSince(epoch, 2015, 7, 1, 20, 0, 0, 0)}; -auto array0 = - MakeArrowTypeArray(date32(), field0_data, validity); -// expected output -auto exp = MakeArrowArray( - {"2000-01-01", "1999-12-31", "2015-06-30", "2015-07-01"}, {true, true, true, true}); - -// prepare input record batch -auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0}); - -// Evaluate expression -arrow::ArrayVector outputs; -status = projector->Evaluate(*in_batch, pool_, &outputs); -EXPECT_TRUE(status.ok()) << status.message(); - -// Validate results -EXPECT_ARROW_ARRAY_EQUALS(exp, outputs.at(0)); + // schema for input fields + auto field_date32 = field("f_date32", arrow::date32()); + auto node_date32 = TreeExprBuilder::MakeField(field_date32); + auto schema = arrow::schema({field_date32}); + + // output fields + auto field_0 = field("date32_str", arrow::utf8()); + + // Build expression + auto int64_literal = TreeExprBuilder::MakeLiteral(10L); + auto func0 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_date32, int64_literal}, + arrow::utf8()); + auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); + std::shared_ptr projector; + auto status = Projector::Make(schema, {expr0}, TestConfiguration(), &projector); + EXPECT_TRUE(status.ok()) << status.message(); + + // Create a row-batch with some sample data + int num_records = 4; + time_t epoch = Epoch(); + auto validity = {true, true, true, true}; + std::vector field0_data = {DaysSince(epoch, 2000, 1, 1, 5, 0, 0, 0), + DaysSince(epoch, 1999, 12, 31, 5, 0, 0, 0), + DaysSince(epoch, 2015, 6, 30, 20, 0, 0, 0), + DaysSince(epoch, 2015, 7, 1, 20, 0, 0, 0)}; + auto array0 = + MakeArrowTypeArray(date32(), field0_data, validity); + // expected output + auto exp = MakeArrowArray( + {"2000-01-01", "1999-12-31", "2015-06-30", "2015-07-01"}, {true, true, true, true}); + + // prepare input record batch + auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0}); + + // Evaluate expression + arrow::ArrayVector outputs; + status = projector->Evaluate(*in_batch, pool_, &outputs); + EXPECT_TRUE(status.ok()) << status.message(); + + // Validate results + EXPECT_ARROW_ARRAY_EQUALS(exp, outputs.at(0)); } } // namespace gandiva diff --git a/cpp/src/gandiva/tests/decimal_single_test.cc b/cpp/src/gandiva/tests/decimal_single_test.cc index 666ee4a68d5de..261e52ccf0135 100644 --- a/cpp/src/gandiva/tests/decimal_single_test.cc +++ b/cpp/src/gandiva/tests/decimal_single_test.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include + #include -#include #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/decimal_scalar.h" #include "gandiva/decimal_type_util.h" #include "gandiva/projector.h" diff --git a/cpp/src/gandiva/tests/decimal_test.cc b/cpp/src/gandiva/tests/decimal_test.cc index 51e9dcb3c870b..4f899bd78be6e 100644 --- a/cpp/src/gandiva/tests/decimal_test.cc +++ b/cpp/src/gandiva/tests/decimal_test.cc @@ -15,13 +15,14 @@ // specific language governing permissions and limitations // under the License. -#include +#include "arrow/util/decimal.h" #include + +#include + #include "arrow/memory_pool.h" #include "arrow/status.h" -#include "arrow/util/decimal.h" - #include "gandiva/decimal_type_util.h" #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" diff --git a/cpp/src/gandiva/tests/filter_project_test.cc b/cpp/src/gandiva/tests/filter_project_test.cc index 0607feaef54e7..92a66b61c73f3 100644 --- a/cpp/src/gandiva/tests/filter_project_test.cc +++ b/cpp/src/gandiva/tests/filter_project_test.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "gandiva/filter.h" #include "gandiva/projector.h" diff --git a/cpp/src/gandiva/tests/filter_test.cc b/cpp/src/gandiva/tests/filter_test.cc index d4433f11eb1a8..b02dea635a0f4 100644 --- a/cpp/src/gandiva/tests/filter_test.cc +++ b/cpp/src/gandiva/tests/filter_test.cc @@ -16,7 +16,9 @@ // under the License. #include "gandiva/filter.h" + #include + #include "arrow/memory_pool.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/generate_data.h b/cpp/src/gandiva/tests/generate_data.h index 9fb0e4eaef6fb..572dd0e8ec868 100644 --- a/cpp/src/gandiva/tests/generate_data.h +++ b/cpp/src/gandiva/tests/generate_data.h @@ -16,6 +16,7 @@ // under the License. #include + #include #include diff --git a/cpp/src/gandiva/tests/hash_test.cc b/cpp/src/gandiva/tests/hash_test.cc index 363e15aa713e4..f76cfec5eff8a 100644 --- a/cpp/src/gandiva/tests/hash_test.cc +++ b/cpp/src/gandiva/tests/hash_test.cc @@ -15,15 +15,15 @@ // specific language governing permissions and limitations // under the License. -#include - #include #include + #include +#include +#include + #include "arrow/memory_pool.h" #include "arrow/status.h" - -#include #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/huge_table_test.cc b/cpp/src/gandiva/tests/huge_table_test.cc index 46f814b472d84..07324b6866ae5 100644 --- a/cpp/src/gandiva/tests/huge_table_test.cc +++ b/cpp/src/gandiva/tests/huge_table_test.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "gandiva/filter.h" #include "gandiva/projector.h" diff --git a/cpp/src/gandiva/tests/if_expr_test.cc b/cpp/src/gandiva/tests/if_expr_test.cc index 54b6d43b4df1c..8a615191bed5c 100644 --- a/cpp/src/gandiva/tests/if_expr_test.cc +++ b/cpp/src/gandiva/tests/if_expr_test.cc @@ -16,9 +16,9 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/literal_test.cc b/cpp/src/gandiva/tests/literal_test.cc index b5ffff0319f92..b62ccb4b93088 100644 --- a/cpp/src/gandiva/tests/literal_test.cc +++ b/cpp/src/gandiva/tests/literal_test.cc @@ -16,9 +16,9 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/tests/micro_benchmarks.cc b/cpp/src/gandiva/tests/micro_benchmarks.cc index 35c77e3dd82de..7381006852aad 100644 --- a/cpp/src/gandiva/tests/micro_benchmarks.cc +++ b/cpp/src/gandiva/tests/micro_benchmarks.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" #include "benchmark/benchmark.h" diff --git a/cpp/src/gandiva/tests/null_validity_test.cc b/cpp/src/gandiva/tests/null_validity_test.cc index 0374b68d46288..37171bd3f839c 100644 --- a/cpp/src/gandiva/tests/null_validity_test.cc +++ b/cpp/src/gandiva/tests/null_validity_test.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "gandiva/filter.h" #include "gandiva/projector.h" diff --git a/cpp/src/gandiva/tests/projector_build_validation_test.cc b/cpp/src/gandiva/tests/projector_build_validation_test.cc index 5b86844f940bf..56128c25b5546 100644 --- a/cpp/src/gandiva/tests/projector_build_validation_test.cc +++ b/cpp/src/gandiva/tests/projector_build_validation_test.cc @@ -16,6 +16,7 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" diff --git a/cpp/src/gandiva/tests/projector_test.cc b/cpp/src/gandiva/tests/projector_test.cc index 648966cc96db3..28a4349cf2c1c 100644 --- a/cpp/src/gandiva/tests/projector_test.cc +++ b/cpp/src/gandiva/tests/projector_test.cc @@ -224,8 +224,8 @@ TEST_F(TestProjector, TestShiftRight) { auto field_shift_right = field("shift_right", int32()); // Build expression - auto shift_right_expr = TreeExprBuilder::MakeExpression("shift_right", {field0, field1}, - field_shift_right); + auto shift_right_expr = + TreeExprBuilder::MakeExpression("shift_right", {field0, field1}, field_shift_right); std::shared_ptr projector; @@ -257,7 +257,6 @@ TEST_F(TestProjector, TestShiftRight) { EXPECT_ARROW_ARRAY_EQUALS(exp_shift_right, outputs.at(0)); } - TEST_F(TestProjector, TestShiftLeft) { // schema for input fields auto field0 = field("f0", int32()); @@ -268,8 +267,8 @@ TEST_F(TestProjector, TestShiftLeft) { auto field_shift_left = field("shift_left", int32()); // Build expression - auto shift_left_expr = TreeExprBuilder::MakeExpression("shift_left", {field0, field1}, - field_shift_left); + auto shift_left_expr = + TreeExprBuilder::MakeExpression("shift_left", {field0, field1}, field_shift_left); std::shared_ptr projector; @@ -1099,104 +1098,104 @@ TEST_F(TestProjector, TestIfElseOpt) { } TEST_F(TestProjector, TestCastToUTF8) { -// schema for input fields -auto field_float64 = field("f_float64", arrow::float64()); -auto field_int32 = field("f_int32", arrow::int32()); -auto schema = arrow::schema({field_float64, field_int32}); - -// output fields -auto field_0 = field("float64_str", arrow::utf8()); -auto field_1 = field("int32_str", arrow::utf8()); - -// Build expression -auto node_a = TreeExprBuilder::MakeField(field_float64); -auto node_b = TreeExprBuilder::MakeField(field_int32); -auto int64_literal_0 = TreeExprBuilder::MakeLiteral(21L); -auto int64_literal_1 = TreeExprBuilder::MakeLiteral(11L); -auto func0 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_a, int64_literal_0}, - arrow::utf8()); -auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); -auto func1 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_b, int64_literal_1}, - arrow::utf8()); -auto expr1 = TreeExprBuilder::MakeExpression(func1, field_1); - -std::shared_ptr projector; -auto status = Projector::Make(schema, {expr0, expr1}, TestConfiguration(), &projector); -EXPECT_TRUE(status.ok()) << status.message(); - -// Create a row-batch with some sample data -int num_records = 4; -auto array0 = MakeArrowArrayFloat64({1989278888.23f, 5.892732f, -23487.3f, 9.712717f}, - {true, true, true, true}); -auto array1 = MakeArrowArrayInt32({5, 6, 7, 8}, {true, true, true, true}); -// expected output -auto exp_0 = MakeArrowArray( - {"1.98928e+09", "5.89273", "-23487.3", "9.71272"}, {true, true, true, true}); -auto exp_1 = MakeArrowArray({"5", "6", "7", "8"}, - {true, true, true, true}); - -// prepare input record batch -auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0, array1}); - -// Evaluate expression -arrow::ArrayVector outputs; -status = projector->Evaluate(*in_batch, pool_, &outputs); -EXPECT_TRUE(status.ok()) << status.message(); - -// Validate results -EXPECT_ARROW_ARRAY_EQUALS(exp_0, outputs.at(0)); -EXPECT_ARROW_ARRAY_EQUALS(exp_1, outputs.at(1)); + // schema for input fields + auto field_float64 = field("f_float64", arrow::float64()); + auto field_int32 = field("f_int32", arrow::int32()); + auto schema = arrow::schema({field_float64, field_int32}); + + // output fields + auto field_0 = field("float64_str", arrow::utf8()); + auto field_1 = field("int32_str", arrow::utf8()); + + // Build expression + auto node_a = TreeExprBuilder::MakeField(field_float64); + auto node_b = TreeExprBuilder::MakeField(field_int32); + auto int64_literal_0 = TreeExprBuilder::MakeLiteral(21L); + auto int64_literal_1 = TreeExprBuilder::MakeLiteral(11L); + auto func0 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_a, int64_literal_0}, + arrow::utf8()); + auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); + auto func1 = TreeExprBuilder::MakeFunction("castVARCHAR", {node_b, int64_literal_1}, + arrow::utf8()); + auto expr1 = TreeExprBuilder::MakeExpression(func1, field_1); + + std::shared_ptr projector; + auto status = Projector::Make(schema, {expr0, expr1}, TestConfiguration(), &projector); + EXPECT_TRUE(status.ok()) << status.message(); + + // Create a row-batch with some sample data + int num_records = 4; + auto array0 = MakeArrowArrayFloat64({1989278888.23f, 5.892732f, -23487.3f, 9.712717f}, + {true, true, true, true}); + auto array1 = MakeArrowArrayInt32({5, 6, 7, 8}, {true, true, true, true}); + // expected output + auto exp_0 = MakeArrowArray( + {"1.98928e+09", "5.89273", "-23487.3", "9.71272"}, {true, true, true, true}); + auto exp_1 = MakeArrowArray({"5", "6", "7", "8"}, + {true, true, true, true}); + + // prepare input record batch + auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0, array1}); + + // Evaluate expression + arrow::ArrayVector outputs; + status = projector->Evaluate(*in_batch, pool_, &outputs); + EXPECT_TRUE(status.ok()) << status.message(); + + // Validate results + EXPECT_ARROW_ARRAY_EQUALS(exp_0, outputs.at(0)); + EXPECT_ARROW_ARRAY_EQUALS(exp_1, outputs.at(1)); } TEST_F(TestProjector, TestCastToByte) { -// schema for input fields -auto field_int16 = field("f_int16", arrow::int16()); -auto field_int64 = field("f_int64", arrow::int64()); -auto field_int32 = field("f_int32", arrow::int32()); -auto schema = arrow::schema({field_int16, field_int64, field_int32}); - -// output fields -auto field_0 = field("out_0", arrow::int8()); -auto field_1 = field("out_1", arrow::int8()); -auto field_2 = field("out_2", arrow::int8()); - -// Build expression -auto node_a = TreeExprBuilder::MakeField(field_int16); -auto node_b = TreeExprBuilder::MakeField(field_int64); -auto node_c = TreeExprBuilder::MakeField(field_int32); -auto func0 = TreeExprBuilder::MakeFunction("castBYTE", {node_a}, arrow::int8()); -auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); -auto func1 = TreeExprBuilder::MakeFunction("castBYTE", {node_b}, arrow::int8()); -auto expr1 = TreeExprBuilder::MakeExpression(func1, field_1); -auto func2 = TreeExprBuilder::MakeFunction("castBYTE", {node_c}, arrow::int8()); -auto expr2 = TreeExprBuilder::MakeExpression(func2, field_2); - -std::shared_ptr projector; -auto status = - Projector::Make(schema, {expr0, expr1, expr2}, TestConfiguration(), &projector); -EXPECT_TRUE(status.ok()) << status.message(); - -// Create a row-batch with some sample data -int num_records = 4; -auto array0 = MakeArrowArrayInt16({5, 6, 7, 8}, {true, true, true, true}); -auto array1 = MakeArrowArrayInt64({5L, 6L, 7L, 257L}, {true, true, true, true}); -auto array2 = MakeArrowArrayInt32({5, 6, 7, 8}, {true, true, true, true}); -// expected output -auto exp_0 = MakeArrowArrayInt8({5, 6, 7, 8}, {true, true, true, true}); -auto exp_1 = MakeArrowArrayInt8({5, 6, 7, 1}, {true, true, true, true}); -auto exp_2 = MakeArrowArrayInt8({5, 6, 7, 8}, {true, true, true, true}); - -// prepare input record batch -auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0, array1, array2}); - -// Evaluate expression -arrow::ArrayVector outputs; -status = projector->Evaluate(*in_batch, pool_, &outputs); -EXPECT_TRUE(status.ok()) << status.message(); - -// Validate results -EXPECT_ARROW_ARRAY_EQUALS(exp_0, outputs.at(0)); -EXPECT_ARROW_ARRAY_EQUALS(exp_1, outputs.at(1)); -EXPECT_ARROW_ARRAY_EQUALS(exp_2, outputs.at(2)); + // schema for input fields + auto field_int16 = field("f_int16", arrow::int16()); + auto field_int64 = field("f_int64", arrow::int64()); + auto field_int32 = field("f_int32", arrow::int32()); + auto schema = arrow::schema({field_int16, field_int64, field_int32}); + + // output fields + auto field_0 = field("out_0", arrow::int8()); + auto field_1 = field("out_1", arrow::int8()); + auto field_2 = field("out_2", arrow::int8()); + + // Build expression + auto node_a = TreeExprBuilder::MakeField(field_int16); + auto node_b = TreeExprBuilder::MakeField(field_int64); + auto node_c = TreeExprBuilder::MakeField(field_int32); + auto func0 = TreeExprBuilder::MakeFunction("castBYTE", {node_a}, arrow::int8()); + auto expr0 = TreeExprBuilder::MakeExpression(func0, field_0); + auto func1 = TreeExprBuilder::MakeFunction("castBYTE", {node_b}, arrow::int8()); + auto expr1 = TreeExprBuilder::MakeExpression(func1, field_1); + auto func2 = TreeExprBuilder::MakeFunction("castBYTE", {node_c}, arrow::int8()); + auto expr2 = TreeExprBuilder::MakeExpression(func2, field_2); + + std::shared_ptr projector; + auto status = + Projector::Make(schema, {expr0, expr1, expr2}, TestConfiguration(), &projector); + EXPECT_TRUE(status.ok()) << status.message(); + + // Create a row-batch with some sample data + int num_records = 4; + auto array0 = MakeArrowArrayInt16({5, 6, 7, 8}, {true, true, true, true}); + auto array1 = MakeArrowArrayInt64({5L, 6L, 7L, 257L}, {true, true, true, true}); + auto array2 = MakeArrowArrayInt32({5, 6, 7, 8}, {true, true, true, true}); + // expected output + auto exp_0 = MakeArrowArrayInt8({5, 6, 7, 8}, {true, true, true, true}); + auto exp_1 = MakeArrowArrayInt8({5, 6, 7, 1}, {true, true, true, true}); + auto exp_2 = MakeArrowArrayInt8({5, 6, 7, 8}, {true, true, true, true}); + + // prepare input record batch + auto in_batch = arrow::RecordBatch::Make(schema, num_records, {array0, array1, array2}); + + // Evaluate expression + arrow::ArrayVector outputs; + status = projector->Evaluate(*in_batch, pool_, &outputs); + EXPECT_TRUE(status.ok()) << status.message(); + + // Validate results + EXPECT_ARROW_ARRAY_EQUALS(exp_0, outputs.at(0)); + EXPECT_ARROW_ARRAY_EQUALS(exp_1, outputs.at(1)); + EXPECT_ARROW_ARRAY_EQUALS(exp_2, outputs.at(2)); } } // namespace gandiva diff --git a/cpp/src/gandiva/tests/timed_evaluate.h b/cpp/src/gandiva/tests/timed_evaluate.h index eba0f5eb96388..e50d6e28b242b 100644 --- a/cpp/src/gandiva/tests/timed_evaluate.h +++ b/cpp/src/gandiva/tests/timed_evaluate.h @@ -17,6 +17,7 @@ #include #include + #include "benchmark/benchmark.h" #include "gandiva/arrow.h" #include "gandiva/filter.h" diff --git a/cpp/src/gandiva/tests/to_string_test.cc b/cpp/src/gandiva/tests/to_string_test.cc index 55db6e92b7225..f3198b1416b7e 100644 --- a/cpp/src/gandiva/tests/to_string_test.cc +++ b/cpp/src/gandiva/tests/to_string_test.cc @@ -18,6 +18,7 @@ #include #include #include + #include "arrow/memory_pool.h" #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" diff --git a/cpp/src/gandiva/tests/utf8_test.cc b/cpp/src/gandiva/tests/utf8_test.cc index 01e62a59379e0..ab69582b5c408 100644 --- a/cpp/src/gandiva/tests/utf8_test.cc +++ b/cpp/src/gandiva/tests/utf8_test.cc @@ -16,9 +16,9 @@ // under the License. #include + #include "arrow/memory_pool.h" #include "arrow/status.h" - #include "gandiva/projector.h" #include "gandiva/tests/test_util.h" #include "gandiva/tree_expr_builder.h" diff --git a/cpp/src/gandiva/to_date_holder.h b/cpp/src/gandiva/to_date_holder.h index 1211b6a3043ad..52b3e5f0d728e 100644 --- a/cpp/src/gandiva/to_date_holder.h +++ b/cpp/src/gandiva/to_date_holder.h @@ -22,7 +22,6 @@ #include #include "arrow/status.h" - #include "gandiva/execution_context.h" #include "gandiva/function_holder.h" #include "gandiva/node.h" diff --git a/cpp/src/gandiva/to_date_holder_test.cc b/cpp/src/gandiva/to_date_holder_test.cc index a420774bfcea9..be864da343688 100644 --- a/cpp/src/gandiva/to_date_holder_test.cc +++ b/cpp/src/gandiva/to_date_holder_test.cc @@ -15,17 +15,17 @@ // specific language governing permissions and limitations // under the License. +#include "gandiva/to_date_holder.h" + +#include + #include #include #include "arrow/testing/gtest_util.h" - #include "gandiva/execution_context.h" -#include "gandiva/to_date_holder.h" #include "precompiled/epoch_time_point.h" -#include - namespace gandiva { class TestToDateHolder : public ::testing::Test { diff --git a/cpp/src/gandiva/tree_expr_test.cc b/cpp/src/gandiva/tree_expr_test.cc index e70cf12898124..ef347f757f4c7 100644 --- a/cpp/src/gandiva/tree_expr_test.cc +++ b/cpp/src/gandiva/tree_expr_test.cc @@ -15,9 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "gandiva/tree_expr_builder.h" - #include + #include "gandiva/annotator.h" #include "gandiva/dex.h" #include "gandiva/expr_decomposer.h" @@ -25,6 +24,7 @@ #include "gandiva/function_signature.h" #include "gandiva/gandiva_aliases.h" #include "gandiva/node.h" +#include "gandiva/tree_expr_builder.h" namespace gandiva { diff --git a/cpp/src/jni/dataset/jni_wrapper.cc b/cpp/src/jni/dataset/jni_wrapper.cc index b319f18f5ad22..718e7614abd4b 100644 --- a/cpp/src/jni/dataset/jni_wrapper.cc +++ b/cpp/src/jni/dataset/jni_wrapper.cc @@ -25,9 +25,7 @@ #include "arrow/ipc/api.h" #include "arrow/jniutil/jni_util.h" #include "arrow/util/iterator.h" - #include "jni/dataset/DTypes.pb.h" - #include "org_apache_arrow_dataset_file_JniWrapper.h" #include "org_apache_arrow_dataset_jni_JniWrapper.h" #include "org_apache_arrow_dataset_jni_NativeMemoryPool.h" @@ -162,7 +160,8 @@ void releaseFilterInput(jbyteArray condition_arr, jbyte* condition_bytes, JNIEnv } // fixme in development. Not all node types considered. -arrow::dataset::Expression translateNode(arrow::dataset::types::TreeNode node, JNIEnv* env) { +arrow::dataset::Expression translateNode(arrow::dataset::types::TreeNode node, + JNIEnv* env) { if (node.has_fieldnode()) { const arrow::dataset::types::FieldNode& f_node = node.fieldnode(); const std::string& name = f_node.name(); @@ -197,21 +196,23 @@ arrow::dataset::Expression translateNode(arrow::dataset::types::TreeNode node, J const arrow::dataset::types::AndNode& and_node = node.andnode(); const arrow::dataset::types::TreeNode& left_arg = and_node.leftarg(); const arrow::dataset::types::TreeNode& right_arg = and_node.rightarg(); - return arrow::dataset::and_(translateNode(left_arg, env), translateNode(right_arg, env)); + return arrow::dataset::and_(translateNode(left_arg, env), + translateNode(right_arg, env)); } if (node.has_ornode()) { const arrow::dataset::types::OrNode& or_node = node.ornode(); const arrow::dataset::types::TreeNode& left_arg = or_node.leftarg(); const arrow::dataset::types::TreeNode& right_arg = or_node.rightarg(); - return arrow::dataset::or_(translateNode(left_arg, env), translateNode(right_arg, env)); + return arrow::dataset::or_(translateNode(left_arg, env), + translateNode(right_arg, env)); } if (node.has_cpnode()) { const arrow::dataset::types::ComparisonNode& cp_node = node.cpnode(); const std::string& op_name = cp_node.opname(); const arrow::dataset::types::TreeNode& left_arg = cp_node.leftarg(); const arrow::dataset::types::TreeNode& right_arg = cp_node.rightarg(); - return arrow::dataset::call(op_name, - {translateNode(left_arg, env), translateNode(right_arg, env)}); + return arrow::dataset::call( + op_name, {translateNode(left_arg, env), translateNode(right_arg, env)}); } if (node.has_notnode()) { const arrow::dataset::types::NotNode& not_node = node.notnode(); @@ -226,10 +227,11 @@ arrow::dataset::Expression translateNode(arrow::dataset::types::TreeNode node, J return arrow::dataset::call("is_valid", {translatedChild}); } JniThrow("Unknown node type"); - return arrow::dataset::literal(false); // unreachable + return arrow::dataset::literal(false); // unreachable } -arrow::dataset::Expression translateFilter(arrow::dataset::types::Condition condition, JNIEnv* env) { +arrow::dataset::Expression translateFilter(arrow::dataset::types::Condition condition, + JNIEnv* env) { const arrow::dataset::types::TreeNode& tree_node = condition.root(); return translateNode(tree_node, env); } @@ -312,9 +314,8 @@ class SimpleIteratorFragment : public arrow::dataset::Fragment { arrow::Result> FromBytes( JNIEnv* env, std::shared_ptr schema, jbyteArray bytes) { - ARROW_ASSIGN_OR_RAISE( - std::shared_ptr batch, - arrow::jniutil::DeserializeUnsafeFromJava(env, schema, bytes)) + ARROW_ASSIGN_OR_RAISE(std::shared_ptr batch, + arrow::jniutil::DeserializeUnsafeFromJava(env, schema, bytes)) return batch; } @@ -456,8 +457,8 @@ Java_org_apache_arrow_dataset_jni_NativeMemoryPool_createListenableMemoryPool( } std::shared_ptr listener = std::make_shared(vm, jlistener_ref); - auto memory_pool = - new ReservationListenableMemoryPool(arrow::default_memory_pool(), listener, 8 * 1024 * 1024); + auto memory_pool = new ReservationListenableMemoryPool(arrow::default_memory_pool(), + listener, 8 * 1024 * 1024); return reinterpret_cast(memory_pool); JNI_METHOD_END(-1L) } @@ -568,8 +569,8 @@ JNIEXPORT void JNICALL Java_org_apache_arrow_dataset_jni_JniWrapper_closeDataset * Signature: (J[Ljava/lang/String;[BJJ)J */ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_jni_JniWrapper_createScanner( - JNIEnv* env, jobject, jlong dataset_id, jobjectArray columns, jbyteArray filter, jlong batch_size, - jlong memory_pool_id) { + JNIEnv* env, jobject, jlong dataset_id, jobjectArray columns, jbyteArray filter, + jlong batch_size, jlong memory_pool_id) { JNI_METHOD_START arrow::MemoryPool* pool = reinterpret_cast(memory_pool_id); if (pool == nullptr) { @@ -706,8 +707,8 @@ Java_org_apache_arrow_dataset_file_JniWrapper_newJniMethodReference(JNIEnv* env, */ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_makeFileSystemDatasetFactory( - JNIEnv* env, jobject, jstring uri, jlong file_format_id, - jlong start_offset, jlong length) { + JNIEnv* env, jobject, jstring uri, jlong file_format_id, jlong start_offset, + jlong length) { JNI_METHOD_START std::shared_ptr file_format = JniGetOrThrow(GetFileFormat(file_format_id)); @@ -761,8 +762,9 @@ Java_org_apache_arrow_dataset_file_JniWrapper_writeFromScannerToFile( * Method: createParquetFileFormat * Signature: ([Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createParquetFileFormat - (JNIEnv* env, jobject, jobjectArray dict_columns) { +JNIEXPORT jlong JNICALL +Java_org_apache_arrow_dataset_file_JniWrapper_createParquetFileFormat( + JNIEnv* env, jobject, jobjectArray dict_columns) { JNI_METHOD_START auto format = std::make_shared(); auto dict_column_vector = ToStringVector(env, dict_columns); @@ -777,8 +779,8 @@ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createParq * Method: createOrcFileFormat * Signature: ([Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createOrcFileFormat - (JNIEnv* env, jobject, jobjectArray dict_columns) { +JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createOrcFileFormat( + JNIEnv* env, jobject, jobjectArray dict_columns) { JNI_METHOD_START auto format = std::make_shared(); auto dict_column_vector = ToStringVector(env, dict_columns); @@ -793,8 +795,8 @@ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createOrcF * Method: createCsvFileFormat * Signature: (C)J */ -JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createCsvFileFormat - (JNIEnv* env, jobject, jchar delimiter){ +JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createCsvFileFormat( + JNIEnv* env, jobject, jchar delimiter) { JNI_METHOD_START auto format = std::make_shared(); format->parse_options.delimiter = static_cast(delimiter); @@ -807,8 +809,9 @@ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_createCsvF * Method: releaseFileFormatInstance * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_releaseFileFormatInstance - (JNIEnv* env, jobject, jlong instance_id){ +JNIEXPORT void JNICALL +Java_org_apache_arrow_dataset_file_JniWrapper_releaseFileFormatInstance( + JNIEnv* env, jobject, jlong instance_id) { JNI_METHOD_START arrow::jniutil::ReleaseNativeRef(instance_id); JNI_METHOD_END() diff --git a/cpp/src/jni/orc/jni_wrapper.cpp b/cpp/src/jni/orc/jni_wrapper.cpp index e6fc82312d552..414852193cd1f 100644 --- a/cpp/src/jni/orc/jni_wrapper.cpp +++ b/cpp/src/jni/orc/jni_wrapper.cpp @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include - #include #include #include @@ -27,12 +23,15 @@ #include #include +#include +#include +#include + +#include "./concurrent_map.h" #include "org_apache_arrow_adapter_orc_OrcMemoryJniWrapper.h" #include "org_apache_arrow_adapter_orc_OrcReaderJniWrapper.h" #include "org_apache_arrow_adapter_orc_OrcStripeReaderJniWrapper.h" -#include "./concurrent_map.h" - using ORCFileReader = arrow::adapters::orc::ORCFileReader; using RecordBatchReader = arrow::RecordBatchReader; diff --git a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc index 303fb4548807e..59d1e2d4fa2df 100644 --- a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc +++ b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc @@ -21,8 +21,6 @@ #pragma warning(disable : 4800) #endif -#include "gtest/gtest.h" - #include #include #include @@ -48,10 +46,9 @@ #include "arrow/util/future.h" #include "arrow/util/logging.h" #include "arrow/util/range.h" - +#include "gtest/gtest.h" #include "parquet/api/reader.h" #include "parquet/api/writer.h" - #include "parquet/arrow/reader.h" #include "parquet/arrow/reader_internal.h" #include "parquet/arrow/schema.h" diff --git a/cpp/src/parquet/arrow/arrow_schema_test.cc b/cpp/src/parquet/arrow/arrow_schema_test.cc index 4c5a24bcb9f2e..ad17c558649b4 100644 --- a/cpp/src/parquet/arrow/arrow_schema_test.cc +++ b/cpp/src/parquet/arrow/arrow_schema_test.cc @@ -18,9 +18,12 @@ #include #include +#include "arrow/array.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/type.h" +#include "arrow/util/key_value_metadata.h" #include "gmock/gmock.h" #include "gtest/gtest.h" - #include "parquet/arrow/reader.h" #include "parquet/arrow/reader_internal.h" #include "parquet/arrow/schema.h" @@ -28,11 +31,6 @@ #include "parquet/schema.h" #include "parquet/test_util.h" -#include "arrow/array.h" -#include "arrow/testing/gtest_util.h" -#include "arrow/type.h" -#include "arrow/util/key_value_metadata.h" - using arrow::ArrayFromVector; using arrow::Field; using arrow::TimeUnit; diff --git a/cpp/src/parquet/arrow/path_internal.h b/cpp/src/parquet/arrow/path_internal.h index c5b7fdfdac378..0ac6cfc51aba4 100644 --- a/cpp/src/parquet/arrow/path_internal.h +++ b/cpp/src/parquet/arrow/path_internal.h @@ -24,7 +24,6 @@ #include "arrow/result.h" #include "arrow/status.h" - #include "parquet/platform.h" namespace arrow { diff --git a/cpp/src/parquet/arrow/path_internal_test.cc b/cpp/src/parquet/arrow/path_internal_test.cc index 065e9866e0b4a..a576d89616b9b 100644 --- a/cpp/src/parquet/arrow/path_internal_test.cc +++ b/cpp/src/parquet/arrow/path_internal_test.cc @@ -17,16 +17,15 @@ #include "parquet/arrow/path_internal.h" +#include +#include + #include #include #include -#include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/type.h" - #include "parquet/properties.h" namespace parquet { diff --git a/cpp/src/parquet/arrow/reader_writer_benchmark.cc b/cpp/src/parquet/arrow/reader_writer_benchmark.cc index 6f5d195aad6e1..6f6cfb5b9f13d 100644 --- a/cpp/src/parquet/arrow/reader_writer_benchmark.cc +++ b/cpp/src/parquet/arrow/reader_writer_benchmark.cc @@ -15,20 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include #include #include -#include "parquet/arrow/reader.h" -#include "parquet/arrow/writer.h" -#include "parquet/column_reader.h" -#include "parquet/column_writer.h" -#include "parquet/file_reader.h" -#include "parquet/file_writer.h" -#include "parquet/platform.h" - #include "arrow/array.h" #include "arrow/array/builder_primitive.h" #include "arrow/io/memory.h" @@ -36,6 +26,14 @@ #include "arrow/testing/random.h" #include "arrow/util/bitmap_ops.h" #include "arrow/util/logging.h" +#include "benchmark/benchmark.h" +#include "parquet/arrow/reader.h" +#include "parquet/arrow/writer.h" +#include "parquet/column_reader.h" +#include "parquet/column_writer.h" +#include "parquet/file_reader.h" +#include "parquet/file_writer.h" +#include "parquet/platform.h" using arrow::Array; using arrow::ArrayVector; diff --git a/cpp/src/parquet/arrow/reconstruct_internal_test.cc b/cpp/src/parquet/arrow/reconstruct_internal_test.cc index 495b69f9eaba8..8d25383d9d2d7 100644 --- a/cpp/src/parquet/arrow/reconstruct_internal_test.cc +++ b/cpp/src/parquet/arrow/reconstruct_internal_test.cc @@ -15,16 +15,14 @@ // specific language governing permissions and limitations // under the License. -#include "parquet/arrow/path_internal.h" +#include +#include #include #include #include #include -#include -#include - #include "arrow/array/concatenate.h" #include "arrow/chunked_array.h" #include "arrow/io/memory.h" @@ -33,7 +31,7 @@ #include "arrow/type_fwd.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" - +#include "parquet/arrow/path_internal.h" #include "parquet/arrow/reader.h" #include "parquet/arrow/schema.h" #include "parquet/column_writer.h" @@ -113,9 +111,10 @@ class FileBuilder { auto typed_writer = checked_cast>*>(column_writer); - const int64_t num_values = static_cast( - (max_def_level > 0) ? def_levels.size() - : (max_rep_level > 0) ? rep_levels.size() : values.size()); + const int64_t num_values = + static_cast((max_def_level > 0) ? def_levels.size() + : (max_rep_level > 0) ? rep_levels.size() + : values.size()); const int64_t values_written = typed_writer->WriteBatch( num_values, LevelPointerOrNull(def_levels, max_def_level), LevelPointerOrNull(rep_levels, max_rep_level), values.data()); diff --git a/cpp/src/parquet/arrow/schema.cc b/cpp/src/parquet/arrow/schema.cc index 75813da0b502a..94c9c5ea515bc 100644 --- a/cpp/src/parquet/arrow/schema.cc +++ b/cpp/src/parquet/arrow/schema.cc @@ -30,7 +30,6 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/key_value_metadata.h" #include "arrow/util/logging.h" - #include "parquet/arrow/schema_internal.h" #include "parquet/exception.h" #include "parquet/properties.h" diff --git a/cpp/src/parquet/arrow/schema.h b/cpp/src/parquet/arrow/schema.h index dd60fde434228..997f50d95d8f5 100644 --- a/cpp/src/parquet/arrow/schema.h +++ b/cpp/src/parquet/arrow/schema.h @@ -27,7 +27,6 @@ #include "arrow/status.h" #include "arrow/type.h" #include "arrow/type_fwd.h" - #include "parquet/level_conversion.h" #include "parquet/platform.h" #include "parquet/schema.h" diff --git a/cpp/src/parquet/arrow/writer.cc b/cpp/src/parquet/arrow/writer.cc index 2a22023145305..f823fdcec6875 100644 --- a/cpp/src/parquet/arrow/writer.cc +++ b/cpp/src/parquet/arrow/writer.cc @@ -36,7 +36,6 @@ #include "arrow/util/logging.h" #include "arrow/util/make_unique.h" #include "arrow/visitor_inline.h" - #include "parquet/arrow/path_internal.h" #include "parquet/arrow/reader_internal.h" #include "parquet/arrow/schema.h" diff --git a/cpp/src/parquet/bloom_filter.cc b/cpp/src/parquet/bloom_filter.cc index f6f6d327d06a3..619fbabc03c2a 100644 --- a/cpp/src/parquet/bloom_filter.cc +++ b/cpp/src/parquet/bloom_filter.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/bloom_filter.h" + #include #include #include "arrow/result.h" #include "arrow/util/logging.h" -#include "parquet/bloom_filter.h" #include "parquet/exception.h" #include "parquet/murmur3.h" diff --git a/cpp/src/parquet/bloom_filter_test.cc b/cpp/src/parquet/bloom_filter_test.cc index 23aa4a580186e..e140e28060208 100644 --- a/cpp/src/parquet/bloom_filter_test.cc +++ b/cpp/src/parquet/bloom_filter_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/bloom_filter.h" + #include #include @@ -28,8 +30,6 @@ #include "arrow/io/file.h" #include "arrow/status.h" #include "arrow/testing/gtest_util.h" - -#include "parquet/bloom_filter.h" #include "parquet/exception.h" #include "parquet/murmur3.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/column_io_benchmark.cc b/cpp/src/parquet/column_io_benchmark.cc index 7f96516ef4a78..667d004151859 100644 --- a/cpp/src/parquet/column_io_benchmark.cc +++ b/cpp/src/parquet/column_io_benchmark.cc @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" - #include "arrow/array.h" #include "arrow/io/memory.h" #include "arrow/testing/random.h" - +#include "benchmark/benchmark.h" #include "parquet/column_reader.h" #include "parquet/column_writer.h" #include "parquet/file_reader.h" diff --git a/cpp/src/parquet/column_reader_test.cc b/cpp/src/parquet/column_reader_test.cc index f0025f4c3a93b..2b610cc8ea73e 100644 --- a/cpp/src/parquet/column_reader_test.cc +++ b/cpp/src/parquet/column_reader_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/column_reader.h" + #include #include @@ -28,7 +30,6 @@ #include "arrow/testing/macros.h" #include "parquet/column_page.h" -#include "parquet/column_reader.h" #include "parquet/schema.h" #include "parquet/test_util.h" #include "parquet/types.h" diff --git a/cpp/src/parquet/column_scanner_test.cc b/cpp/src/parquet/column_scanner_test.cc index ea54319babe4f..c1d62ec2bd807 100644 --- a/cpp/src/parquet/column_scanner_test.cc +++ b/cpp/src/parquet/column_scanner_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/column_scanner.h" + #include #include @@ -26,9 +28,7 @@ #include #include "arrow/testing/gtest_compat.h" - #include "parquet/column_page.h" -#include "parquet/column_scanner.h" #include "parquet/schema.h" #include "parquet/test_util.h" #include "parquet/types.h" diff --git a/cpp/src/parquet/column_writer_test.cc b/cpp/src/parquet/column_writer_test.cc index 60e582957a08b..c08be3404b416 100644 --- a/cpp/src/parquet/column_writer_test.cc +++ b/cpp/src/parquet/column_writer_test.cc @@ -15,18 +15,18 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "parquet/column_writer.h" #include +#include +#include + #include "arrow/io/buffered.h" #include "arrow/testing/gtest_util.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_builders.h" - #include "parquet/column_reader.h" -#include "parquet/column_writer.h" #include "parquet/file_writer.h" #include "parquet/metadata.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/encoding.cc b/cpp/src/parquet/encoding.cc index eeeff1c8f9b7a..b76bf359f0b89 100644 --- a/cpp/src/parquet/encoding.cc +++ b/cpp/src/parquet/encoding.cc @@ -42,7 +42,6 @@ #include "arrow/util/rle_encoding.h" #include "arrow/util/ubsan.h" #include "arrow/visitor_inline.h" - #include "parquet/exception.h" #include "parquet/platform.h" #include "parquet/schema.h" diff --git a/cpp/src/parquet/encoding.h b/cpp/src/parquet/encoding.h index a3d8e012b6a52..688be831fac42 100644 --- a/cpp/src/parquet/encoding.h +++ b/cpp/src/parquet/encoding.h @@ -23,7 +23,6 @@ #include #include "arrow/util/spaced.h" - #include "parquet/exception.h" #include "parquet/platform.h" #include "parquet/types.h" diff --git a/cpp/src/parquet/encoding_benchmark.cc b/cpp/src/parquet/encoding_benchmark.cc index 7c5eafd151305..2f4c2440cccfd 100644 --- a/cpp/src/parquet/encoding_benchmark.cc +++ b/cpp/src/parquet/encoding_benchmark.cc @@ -15,7 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark/benchmark.h" +#include +#include #include "arrow/array.h" #include "arrow/array/builder_binary.h" @@ -25,14 +26,11 @@ #include "arrow/testing/util.h" #include "arrow/type.h" #include "arrow/util/byte_stream_split.h" - +#include "benchmark/benchmark.h" #include "parquet/encoding.h" #include "parquet/platform.h" #include "parquet/schema.h" -#include -#include - using arrow::default_memory_pool; using arrow::MemoryPool; diff --git a/cpp/src/parquet/encoding_test.cc b/cpp/src/parquet/encoding_test.cc index 02e81becd4788..9d6fcb2430901 100644 --- a/cpp/src/parquet/encoding_test.cc +++ b/cpp/src/parquet/encoding_test.cc @@ -15,7 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encoding.h" + #include + #include #include #include @@ -34,8 +37,6 @@ #include "arrow/util/bitmap_writer.h" #include "arrow/util/checked_cast.h" #include "arrow/util/endian.h" - -#include "parquet/encoding.h" #include "parquet/platform.h" #include "parquet/schema.h" #include "parquet/test_util.h" diff --git a/cpp/src/parquet/encryption/crypto_factory.cc b/cpp/src/parquet/encryption/crypto_factory.cc index 384516bff47d6..ead11bf293532 100644 --- a/cpp/src/parquet/encryption/crypto_factory.cc +++ b/cpp/src/parquet/encryption/crypto_factory.cc @@ -15,12 +15,12 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encryption/crypto_factory.h" + #include "arrow/result.h" #include "arrow/util/logging.h" #include "arrow/util/string.h" #include "arrow/util/string_view.h" - -#include "parquet/encryption/crypto_factory.h" #include "parquet/encryption/encryption_internal.h" #include "parquet/encryption/file_key_material_store.h" #include "parquet/encryption/file_key_unwrapper.h" diff --git a/cpp/src/parquet/encryption/encryption_internal.cc b/cpp/src/parquet/encryption/encryption_internal.cc index f46274cbedea8..95f6688c5a93e 100644 --- a/cpp/src/parquet/encryption/encryption_internal.cc +++ b/cpp/src/parquet/encryption/encryption_internal.cc @@ -16,6 +16,7 @@ // under the License. #include "parquet/encryption/encryption_internal.h" + #include #include #include diff --git a/cpp/src/parquet/encryption/file_key_unwrapper.cc b/cpp/src/parquet/encryption/file_key_unwrapper.cc index 1d8d35e73753b..ade5bde671a40 100644 --- a/cpp/src/parquet/encryption/file_key_unwrapper.cc +++ b/cpp/src/parquet/encryption/file_key_unwrapper.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encryption/file_key_unwrapper.h" + #include #include "arrow/util/utf8.h" - -#include "parquet/encryption/file_key_unwrapper.h" #include "parquet/encryption/key_metadata.h" namespace parquet { diff --git a/cpp/src/parquet/encryption/file_key_unwrapper.h b/cpp/src/parquet/encryption/file_key_unwrapper.h index 727e82b5b438e..521aa26db2250 100644 --- a/cpp/src/parquet/encryption/file_key_unwrapper.h +++ b/cpp/src/parquet/encryption/file_key_unwrapper.h @@ -18,7 +18,6 @@ #pragma once #include "arrow/util/concurrent_map.h" - #include "parquet/encryption/encryption.h" #include "parquet/encryption/key_material.h" #include "parquet/encryption/key_toolkit.h" diff --git a/cpp/src/parquet/encryption/file_key_wrapper.cc b/cpp/src/parquet/encryption/file_key_wrapper.cc index b931f0fbfee08..3265f2dc46b90 100644 --- a/cpp/src/parquet/encryption/file_key_wrapper.cc +++ b/cpp/src/parquet/encryption/file_key_wrapper.cc @@ -16,6 +16,7 @@ // under the License. #include "parquet/encryption/file_key_wrapper.h" + #include "parquet/encryption/encryption_internal.h" #include "parquet/encryption/key_material.h" #include "parquet/encryption/key_metadata.h" diff --git a/cpp/src/parquet/encryption/file_key_wrapper.h b/cpp/src/parquet/encryption/file_key_wrapper.h index 248c5931af357..520215d48d1b0 100644 --- a/cpp/src/parquet/encryption/file_key_wrapper.h +++ b/cpp/src/parquet/encryption/file_key_wrapper.h @@ -22,7 +22,6 @@ #include #include "arrow/util/concurrent_map.h" - #include "parquet/encryption/file_key_material_store.h" #include "parquet/encryption/key_encryption_key.h" #include "parquet/encryption/key_toolkit.h" diff --git a/cpp/src/parquet/encryption/internal_file_decryptor.cc b/cpp/src/parquet/encryption/internal_file_decryptor.cc index 6381e4f37f77d..1db2fa27dd65d 100644 --- a/cpp/src/parquet/encryption/internal_file_decryptor.cc +++ b/cpp/src/parquet/encryption/internal_file_decryptor.cc @@ -16,6 +16,7 @@ // under the License. #include "parquet/encryption/internal_file_decryptor.h" + #include "parquet/encryption/encryption.h" #include "parquet/encryption/encryption_internal.h" diff --git a/cpp/src/parquet/encryption/internal_file_encryptor.cc b/cpp/src/parquet/encryption/internal_file_encryptor.cc index 15bf52b84dd1b..843e5630e712f 100644 --- a/cpp/src/parquet/encryption/internal_file_encryptor.cc +++ b/cpp/src/parquet/encryption/internal_file_encryptor.cc @@ -16,6 +16,7 @@ // under the License. #include "parquet/encryption/internal_file_encryptor.h" + #include "parquet/encryption/encryption.h" #include "parquet/encryption/encryption_internal.h" diff --git a/cpp/src/parquet/encryption/key_management_test.cc b/cpp/src/parquet/encryption/key_management_test.cc index 81e7d89a302ad..7e83d51c23090 100644 --- a/cpp/src/parquet/encryption/key_management_test.cc +++ b/cpp/src/parquet/encryption/key_management_test.cc @@ -24,7 +24,6 @@ #include "arrow/testing/util.h" #include "arrow/util/logging.h" - #include "parquet/encryption/crypto_factory.h" #include "parquet/encryption/key_toolkit.h" #include "parquet/encryption/test_encryption_util.h" diff --git a/cpp/src/parquet/encryption/key_material.cc b/cpp/src/parquet/encryption/key_material.cc index 372279c33a5bd..42c89f7ca32f5 100644 --- a/cpp/src/parquet/encryption/key_material.cc +++ b/cpp/src/parquet/encryption/key_material.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encryption/key_material.h" + #include "arrow/json/object_parser.h" #include "arrow/json/object_writer.h" - -#include "parquet/encryption/key_material.h" #include "parquet/encryption/key_metadata.h" #include "parquet/exception.h" diff --git a/cpp/src/parquet/encryption/key_metadata.cc b/cpp/src/parquet/encryption/key_metadata.cc index 624626c890cc5..7a2cdea270c32 100644 --- a/cpp/src/parquet/encryption/key_metadata.cc +++ b/cpp/src/parquet/encryption/key_metadata.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encryption/key_metadata.h" + #include "arrow/json/object_parser.h" #include "arrow/json/object_writer.h" - -#include "parquet/encryption/key_metadata.h" #include "parquet/exception.h" using ::arrow::json::internal::ObjectParser; diff --git a/cpp/src/parquet/encryption/key_metadata.h b/cpp/src/parquet/encryption/key_metadata.h index 2281b96e60ec6..dd27b7de0c6a3 100644 --- a/cpp/src/parquet/encryption/key_metadata.h +++ b/cpp/src/parquet/encryption/key_metadata.h @@ -20,7 +20,6 @@ #include #include "arrow/util/variant.h" - #include "parquet/encryption/key_material.h" #include "parquet/exception.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/encryption/key_metadata_test.cc b/cpp/src/parquet/encryption/key_metadata_test.cc index 3f891ef26db83..001fa86b329dd 100644 --- a/cpp/src/parquet/encryption/key_metadata_test.cc +++ b/cpp/src/parquet/encryption/key_metadata_test.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include +#include "parquet/encryption/key_metadata.h" #include +#include + #include "parquet/encryption/key_material.h" -#include "parquet/encryption/key_metadata.h" namespace parquet { namespace encryption { diff --git a/cpp/src/parquet/encryption/key_toolkit_internal.cc b/cpp/src/parquet/encryption/key_toolkit_internal.cc index aecc48793604f..dad1716df0b6b 100644 --- a/cpp/src/parquet/encryption/key_toolkit_internal.cc +++ b/cpp/src/parquet/encryption/key_toolkit_internal.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/base64.h" +#include "parquet/encryption/key_toolkit_internal.h" +#include "arrow/util/base64.h" #include "parquet/encryption/encryption_internal.h" -#include "parquet/encryption/key_toolkit_internal.h" namespace parquet { namespace encryption { diff --git a/cpp/src/parquet/encryption/kms_client.h b/cpp/src/parquet/encryption/kms_client.h index 5ffa604ffd198..bac615552bd66 100644 --- a/cpp/src/parquet/encryption/kms_client.h +++ b/cpp/src/parquet/encryption/kms_client.h @@ -22,7 +22,6 @@ #include #include "arrow/util/mutex.h" - #include "parquet/exception.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/encryption/local_wrap_kms_client.cc b/cpp/src/parquet/encryption/local_wrap_kms_client.cc index 1b89dc57d0e52..a57b1cdf0933f 100644 --- a/cpp/src/parquet/encryption/local_wrap_kms_client.cc +++ b/cpp/src/parquet/encryption/local_wrap_kms_client.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/encryption/local_wrap_kms_client.h" + #include "arrow/json/object_parser.h" #include "arrow/json/object_writer.h" - #include "parquet/encryption/key_toolkit_internal.h" -#include "parquet/encryption/local_wrap_kms_client.h" #include "parquet/exception.h" using ::arrow::json::internal::ObjectParser; diff --git a/cpp/src/parquet/encryption/local_wrap_kms_client.h b/cpp/src/parquet/encryption/local_wrap_kms_client.h index 65cf8f42c7964..1239b313e644b 100644 --- a/cpp/src/parquet/encryption/local_wrap_kms_client.h +++ b/cpp/src/parquet/encryption/local_wrap_kms_client.h @@ -21,7 +21,6 @@ #include #include "arrow/util/concurrent_map.h" - #include "parquet/encryption/kms_client.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/encryption/read_configurations_test.cc b/cpp/src/parquet/encryption/read_configurations_test.cc index c065deac66638..8378fd9671dd7 100644 --- a/cpp/src/parquet/encryption/read_configurations_test.cc +++ b/cpp/src/parquet/encryption/read_configurations_test.cc @@ -22,7 +22,6 @@ #include "arrow/io/file.h" #include "arrow/testing/gtest_compat.h" - #include "parquet/column_reader.h" #include "parquet/column_writer.h" #include "parquet/encryption/test_encryption_util.h" diff --git a/cpp/src/parquet/encryption/test_encryption_util.cc b/cpp/src/parquet/encryption/test_encryption_util.cc index 8fe048e3bcdbb..e47ddb552e39e 100644 --- a/cpp/src/parquet/encryption/test_encryption_util.cc +++ b/cpp/src/parquet/encryption/test_encryption_util.cc @@ -19,11 +19,12 @@ // Parquet column chunk within a row group. It could be extended in the future // to iterate through all data pages in all chunks in a file. -#include +#include "parquet/encryption/test_encryption_util.h" #include -#include "parquet/encryption/test_encryption_util.h" +#include + #include "parquet/file_reader.h" #include "parquet/file_writer.h" #include "parquet/test_util.h" diff --git a/cpp/src/parquet/encryption/test_encryption_util.h b/cpp/src/parquet/encryption/test_encryption_util.h index 32790950f84cc..65abec03fb737 100644 --- a/cpp/src/parquet/encryption/test_encryption_util.h +++ b/cpp/src/parquet/encryption/test_encryption_util.h @@ -21,14 +21,13 @@ #pragma once +#include + #include #include #include -#include - #include "arrow/util/io_util.h" - #include "parquet/encryption/encryption.h" #include "parquet/test_util.h" diff --git a/cpp/src/parquet/encryption/test_in_memory_kms.cc b/cpp/src/parquet/encryption/test_in_memory_kms.cc index c30b3418dbd9c..13ed3e21d990f 100644 --- a/cpp/src/parquet/encryption/test_in_memory_kms.cc +++ b/cpp/src/parquet/encryption/test_in_memory_kms.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "arrow/util/base64.h" +#include "parquet/encryption/test_in_memory_kms.h" +#include "arrow/util/base64.h" #include "parquet/encryption/key_toolkit_internal.h" -#include "parquet/encryption/test_in_memory_kms.h" #include "parquet/exception.h" namespace parquet { diff --git a/cpp/src/parquet/encryption/test_in_memory_kms.h b/cpp/src/parquet/encryption/test_in_memory_kms.h index f54f67da56c5f..cdad67b00321d 100644 --- a/cpp/src/parquet/encryption/test_in_memory_kms.h +++ b/cpp/src/parquet/encryption/test_in_memory_kms.h @@ -20,7 +20,6 @@ #include #include "arrow/util/base64.h" - #include "parquet/encryption/kms_client_factory.h" #include "parquet/encryption/local_wrap_kms_client.h" #include "parquet/platform.h" diff --git a/cpp/src/parquet/encryption/two_level_cache_with_expiration_test.cc b/cpp/src/parquet/encryption/two_level_cache_with_expiration_test.cc index f375a5c5b315c..efaa46d58fb9d 100644 --- a/cpp/src/parquet/encryption/two_level_cache_with_expiration_test.cc +++ b/cpp/src/parquet/encryption/two_level_cache_with_expiration_test.cc @@ -15,16 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "parquet/encryption/two_level_cache_with_expiration.h" #include +#include +#include + #include "arrow/testing/gtest_util.h" #include "arrow/util/concurrent_map.h" -#include "parquet/encryption/two_level_cache_with_expiration.h" - namespace parquet { namespace encryption { namespace test { diff --git a/cpp/src/parquet/encryption/write_configurations_test.cc b/cpp/src/parquet/encryption/write_configurations_test.cc index a7b5a284f60b9..4426668aa09a2 100644 --- a/cpp/src/parquet/encryption/write_configurations_test.cc +++ b/cpp/src/parquet/encryption/write_configurations_test.cc @@ -15,12 +15,10 @@ // specific language governing permissions and limitations // under the License. +#include #include - #include -#include - #include "parquet/column_reader.h" #include "parquet/column_writer.h" #include "parquet/encryption/test_encryption_util.h" diff --git a/cpp/src/parquet/file_deserialize_test.cc b/cpp/src/parquet/file_deserialize_test.cc index d0d333256fb47..c6cf40851aa94 100644 --- a/cpp/src/parquet/file_deserialize_test.cc +++ b/cpp/src/parquet/file_deserialize_test.cc @@ -21,6 +21,10 @@ #include #include +#include "arrow/io/memory.h" +#include "arrow/status.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/util/compression.h" #include "parquet/column_page.h" #include "parquet/column_reader.h" #include "parquet/exception.h" @@ -30,11 +34,6 @@ #include "parquet/thrift_internal.h" #include "parquet/types.h" -#include "arrow/io/memory.h" -#include "arrow/status.h" -#include "arrow/testing/gtest_util.h" -#include "arrow/util/compression.h" - namespace parquet { using ::arrow::io::BufferReader; diff --git a/cpp/src/parquet/file_serialize_test.cc b/cpp/src/parquet/file_serialize_test.cc index 3574d37956169..6751e7dc512ca 100644 --- a/cpp/src/parquet/file_serialize_test.cc +++ b/cpp/src/parquet/file_serialize_test.cc @@ -19,7 +19,6 @@ #include #include "arrow/testing/gtest_compat.h" - #include "parquet/column_reader.h" #include "parquet/column_writer.h" #include "parquet/file_reader.h" diff --git a/cpp/src/parquet/hasher.h b/cpp/src/parquet/hasher.h index d699356a6c4b7..c0596b02d8b13 100644 --- a/cpp/src/parquet/hasher.h +++ b/cpp/src/parquet/hasher.h @@ -18,6 +18,7 @@ #pragma once #include + #include "parquet/types.h" namespace parquet { diff --git a/cpp/src/parquet/level_conversion.cc b/cpp/src/parquet/level_conversion.cc index ffdca476ddd22..71ee198990f7b 100644 --- a/cpp/src/parquet/level_conversion.cc +++ b/cpp/src/parquet/level_conversion.cc @@ -25,7 +25,6 @@ #include "arrow/util/logging.h" #include "arrow/util/optional.h" #include "parquet/exception.h" - #include "parquet/level_comparison.h" #define PARQUET_IMPL_NAMESPACE standard #include "parquet/level_conversion_inc.h" diff --git a/cpp/src/parquet/level_conversion_inc.h b/cpp/src/parquet/level_conversion_inc.h index 75c7716c483cd..9c9917368fb57 100644 --- a/cpp/src/parquet/level_conversion_inc.h +++ b/cpp/src/parquet/level_conversion_inc.h @@ -16,8 +16,6 @@ // under the License. #pragma once -#include "parquet/level_conversion.h" - #include #include #include @@ -29,6 +27,7 @@ #include "arrow/util/simd.h" #include "parquet/exception.h" #include "parquet/level_comparison.h" +#include "parquet/level_conversion.h" namespace parquet { namespace internal { diff --git a/cpp/src/parquet/level_conversion_test.cc b/cpp/src/parquet/level_conversion_test.cc index bfce74ae3a868..b3cd202e97b2c 100644 --- a/cpp/src/parquet/level_conversion_test.cc +++ b/cpp/src/parquet/level_conversion_test.cc @@ -17,9 +17,6 @@ #include "parquet/level_conversion.h" -#include "parquet/level_comparison.h" -#include "parquet/test_util.h" - #include #include @@ -30,6 +27,8 @@ #include "arrow/util/bit_util.h" #include "arrow/util/bitmap.h" #include "arrow/util/ubsan.h" +#include "parquet/level_comparison.h" +#include "parquet/test_util.h" namespace parquet { namespace internal { diff --git a/cpp/src/parquet/platform.cc b/cpp/src/parquet/platform.cc index 5c355c28be1c3..32fa57caa2d9c 100644 --- a/cpp/src/parquet/platform.cc +++ b/cpp/src/parquet/platform.cc @@ -22,7 +22,6 @@ #include #include "arrow/io/memory.h" - #include "parquet/exception.h" namespace parquet { diff --git a/cpp/src/parquet/printer.cc b/cpp/src/parquet/printer.cc index dfd4bd802ee15..cc6ba821fd403 100644 --- a/cpp/src/parquet/printer.cc +++ b/cpp/src/parquet/printer.cc @@ -26,7 +26,6 @@ #include "arrow/util/key_value_metadata.h" #include "arrow/util/string.h" - #include "parquet/column_scanner.h" #include "parquet/exception.h" #include "parquet/file_reader.h" diff --git a/cpp/src/parquet/properties.cc b/cpp/src/parquet/properties.cc index 93638dbe28a92..07256fda0e898 100644 --- a/cpp/src/parquet/properties.cc +++ b/cpp/src/parquet/properties.cc @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/properties.h" + #include #include -#include "parquet/properties.h" - #include "arrow/io/buffered.h" #include "arrow/io/memory.h" #include "arrow/util/logging.h" diff --git a/cpp/src/parquet/properties_test.cc b/cpp/src/parquet/properties_test.cc index 7ce96e4a7d732..8eab559104993 100644 --- a/cpp/src/parquet/properties_test.cc +++ b/cpp/src/parquet/properties_test.cc @@ -15,15 +15,15 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/properties.h" + #include #include #include "arrow/buffer.h" #include "arrow/io/memory.h" - #include "parquet/file_reader.h" -#include "parquet/properties.h" namespace parquet { diff --git a/cpp/src/parquet/reader_test.cc b/cpp/src/parquet/reader_test.cc index 7c2f9d7aa58ce..8768726af7142 100644 --- a/cpp/src/parquet/reader_test.cc +++ b/cpp/src/parquet/reader_test.cc @@ -17,6 +17,7 @@ #include #include + #include #include #include @@ -29,7 +30,6 @@ #include "arrow/testing/gtest_util.h" #include "arrow/testing/random.h" #include "arrow/util/checked_cast.h" - #include "parquet/column_reader.h" #include "parquet/column_scanner.h" #include "parquet/file_reader.h" diff --git a/cpp/src/parquet/schema_test.cc b/cpp/src/parquet/schema_test.cc index 43760d34ab413..eae989531f96b 100644 --- a/cpp/src/parquet/schema_test.cc +++ b/cpp/src/parquet/schema_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/schema.h" + #include #include @@ -27,7 +29,6 @@ #include "arrow/util/checked_cast.h" #include "parquet/exception.h" -#include "parquet/schema.h" #include "parquet/schema_internal.h" #include "parquet/thrift_internal.h" #include "parquet/types.h" diff --git a/cpp/src/parquet/statistics_test.cc b/cpp/src/parquet/statistics_test.cc index 8a275fd0936a0..186e636846f44 100644 --- a/cpp/src/parquet/statistics_test.cc +++ b/cpp/src/parquet/statistics_test.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/statistics.h" + #include #include @@ -30,14 +32,12 @@ #include "arrow/type_traits.h" #include "arrow/util/bit_util.h" #include "arrow/util/bitmap_ops.h" - #include "parquet/column_reader.h" #include "parquet/column_writer.h" #include "parquet/file_reader.h" #include "parquet/file_writer.h" #include "parquet/platform.h" #include "parquet/schema.h" -#include "parquet/statistics.h" #include "parquet/test_util.h" #include "parquet/thrift_internal.h" #include "parquet/types.h" diff --git a/cpp/src/parquet/test_util.h b/cpp/src/parquet/test_util.h index b41230827c8c9..e4de1177260b5 100644 --- a/cpp/src/parquet/test_util.h +++ b/cpp/src/parquet/test_util.h @@ -21,6 +21,8 @@ #pragma once +#include + #include #include #include @@ -29,11 +31,8 @@ #include #include -#include - #include "arrow/io/memory.h" #include "arrow/testing/util.h" - #include "parquet/column_page.h" #include "parquet/column_reader.h" #include "parquet/column_writer.h" diff --git a/cpp/src/parquet/thrift_internal.h b/cpp/src/parquet/thrift_internal.h index c9e02696f5dd4..befa13b84b166 100644 --- a/cpp/src/parquet/thrift_internal.h +++ b/cpp/src/parquet/thrift_internal.h @@ -17,9 +17,9 @@ #pragma once -#include "arrow/util/windows_compatibility.h" - #include + +#include "arrow/util/windows_compatibility.h" // Check if thrift version < 0.11.0 // or if FORCE_BOOST_SMART_PTR is defined. Ref: https://thrift.apache.org/lib/cpp #if defined(PARQUET_THRIFT_USE_BOOST) || defined(FORCE_BOOST_SMART_PTR) @@ -34,15 +34,15 @@ #define SIGNED_RIGHT_SHIFT_IS 1 #define ARITHMETIC_RIGHT_SHIFT 1 #include +#include #include #include - -#include #include + #include #include "arrow/util/logging.h" - +#include "generated/parquet_types.h" // IYWU pragma: export #include "parquet/encryption/internal_file_decryptor.h" #include "parquet/encryption/internal_file_encryptor.h" #include "parquet/exception.h" @@ -50,8 +50,6 @@ #include "parquet/statistics.h" #include "parquet/types.h" -#include "generated/parquet_types.h" // IYWU pragma: export - namespace parquet { // Check if thrift version < 0.11.0 diff --git a/cpp/src/parquet/types.cc b/cpp/src/parquet/types.cc index 4e5bcee4ce8f5..e4024907882de 100644 --- a/cpp/src/parquet/types.cc +++ b/cpp/src/parquet/types.cc @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/types.h" + #include #include #include @@ -24,11 +26,8 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/compression.h" #include "arrow/util/logging.h" - -#include "parquet/exception.h" -#include "parquet/types.h" - #include "generated/parquet_types.h" +#include "parquet/exception.h" using arrow::internal::checked_cast; using arrow::util::Codec; diff --git a/cpp/src/parquet/types.h b/cpp/src/parquet/types.h index f3d3abfc918ca..29cc01cf64826 100644 --- a/cpp/src/parquet/types.h +++ b/cpp/src/parquet/types.h @@ -25,7 +25,6 @@ #include #include "arrow/util/string_view.h" - #include "parquet/platform.h" #include "parquet/type_fwd.h" diff --git a/cpp/src/parquet/types_test.cc b/cpp/src/parquet/types_test.cc index e0ca7d6356646..5ea5116fe7529 100644 --- a/cpp/src/parquet/types_test.cc +++ b/cpp/src/parquet/types_test.cc @@ -15,12 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "parquet/types.h" + #include #include #include "arrow/util/endian.h" -#include "parquet/types.h" namespace parquet { diff --git a/cpp/src/plasma/client.cc b/cpp/src/plasma/client.cc index a698aac6a6166..9bdfd798241f6 100644 --- a/cpp/src/plasma/client.cc +++ b/cpp/src/plasma/client.cc @@ -46,7 +46,6 @@ #include "arrow/buffer.h" #include "arrow/util/thread_pool.h" - #include "plasma/common.h" #include "plasma/fling.h" #include "plasma/io.h" diff --git a/cpp/src/plasma/common.cc b/cpp/src/plasma/common.cc index e7d2643d76064..dcad5872efa50 100644 --- a/cpp/src/plasma/common.cc +++ b/cpp/src/plasma/common.cc @@ -21,7 +21,6 @@ #include #include "arrow/util/ubsan.h" - #include "plasma/plasma_generated.h" namespace fb = plasma::flatbuf; diff --git a/cpp/src/plasma/common.h b/cpp/src/plasma/common.h index 9332857f42a1e..289481e377076 100644 --- a/cpp/src/plasma/common.h +++ b/cpp/src/plasma/common.h @@ -29,9 +29,8 @@ #endif #include -#include "plasma/compat.h" - #include "arrow/status.h" +#include "plasma/compat.h" #ifdef PLASMA_CUDA #include "arrow/gpu/cuda_api.h" #endif diff --git a/cpp/src/plasma/dlmalloc.cc b/cpp/src/plasma/dlmalloc.cc index 463e967e036fe..592791c4caa7a 100644 --- a/cpp/src/plasma/dlmalloc.cc +++ b/cpp/src/plasma/dlmalloc.cc @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -#include "plasma/malloc.h" - #include #include #include @@ -30,6 +28,7 @@ #include #include "plasma/common.h" +#include "plasma/malloc.h" #include "plasma/plasma.h" namespace plasma { diff --git a/cpp/src/plasma/events.cc b/cpp/src/plasma/events.cc index 28ff1267545f7..bf97f1d9dc179 100644 --- a/cpp/src/plasma/events.cc +++ b/cpp/src/plasma/events.cc @@ -17,10 +17,10 @@ #include "plasma/events.h" -#include - #include +#include + extern "C" { #include "plasma/thirdparty/ae/ae.h" } diff --git a/cpp/src/plasma/eviction_policy.cc b/cpp/src/plasma/eviction_policy.cc index c3b786785dcd4..aeb8a04c64932 100644 --- a/cpp/src/plasma/eviction_policy.cc +++ b/cpp/src/plasma/eviction_policy.cc @@ -16,11 +16,12 @@ // under the License. #include "plasma/eviction_policy.h" -#include "plasma/plasma_allocator.h" #include #include +#include "plasma/plasma_allocator.h" + namespace plasma { void LRUCache::Add(const ObjectID& key, int64_t size) { diff --git a/cpp/src/plasma/external_store.cc b/cpp/src/plasma/external_store.cc index 8cfbad179ba61..e95dcf48d40d3 100644 --- a/cpp/src/plasma/external_store.cc +++ b/cpp/src/plasma/external_store.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "plasma/external_store.h" + #include #include #include "arrow/util/memory.h" -#include "plasma/external_store.h" - namespace plasma { Status ExternalStores::ExtractStoreName(const std::string& endpoint, diff --git a/cpp/src/plasma/hash_table_store.cc b/cpp/src/plasma/hash_table_store.cc index b77d3693fb206..bd1957ef38a76 100644 --- a/cpp/src/plasma/hash_table_store.cc +++ b/cpp/src/plasma/hash_table_store.cc @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "plasma/hash_table_store.h" + #include #include #include "arrow/util/logging.h" -#include "plasma/hash_table_store.h" - namespace plasma { Status HashTableStore::Connect(const std::string& endpoint) { return Status::OK(); } diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc index 002f4e9991fb8..63948896a7303 100644 --- a/cpp/src/plasma/io.cc +++ b/cpp/src/plasma/io.cc @@ -24,7 +24,6 @@ #include "arrow/status.h" #include "arrow/util/endian.h" #include "arrow/util/logging.h" - #include "plasma/common.h" #include "plasma/plasma_generated.h" diff --git a/cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc b/cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc index 32b48e33e62d8..f0e26c4428a97 100644 --- a/cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc +++ b/cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc @@ -29,7 +29,6 @@ #include #include "arrow/util/logging.h" - #include "plasma/client.h" constexpr jsize OBJECT_ID_SIZE = sizeof(plasma::ObjectID) / sizeof(jbyte); diff --git a/cpp/src/plasma/plasma.h b/cpp/src/plasma/plasma.h index 236f5c948d19a..97e10fdbb9a35 100644 --- a/cpp/src/plasma/plasma.h +++ b/cpp/src/plasma/plasma.h @@ -32,12 +32,11 @@ #include #include -#include "plasma/compat.h" - #include "arrow/status.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" #include "plasma/common.h" +#include "plasma/compat.h" #ifdef PLASMA_CUDA using arrow::cuda::CudaIpcMemHandle; diff --git a/cpp/src/plasma/plasma_allocator.cc b/cpp/src/plasma/plasma_allocator.cc index b67eeea404bce..4306794e0a565 100644 --- a/cpp/src/plasma/plasma_allocator.cc +++ b/cpp/src/plasma/plasma_allocator.cc @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. +#include "plasma/plasma_allocator.h" + #include #include "plasma/malloc.h" -#include "plasma/plasma_allocator.h" namespace plasma { diff --git a/cpp/src/plasma/quota_aware_policy.cc b/cpp/src/plasma/quota_aware_policy.cc index 67c4e92482059..1538db159a9ea 100644 --- a/cpp/src/plasma/quota_aware_policy.cc +++ b/cpp/src/plasma/quota_aware_policy.cc @@ -16,13 +16,14 @@ // under the License. #include "plasma/quota_aware_policy.h" -#include "plasma/common.h" -#include "plasma/plasma_allocator.h" #include #include #include +#include "plasma/common.h" +#include "plasma/plasma_allocator.h" + namespace plasma { QuotaAwarePolicy::QuotaAwarePolicy(PlasmaStoreInfo* store_info, int64_t max_size) diff --git a/cpp/src/plasma/store.cc b/cpp/src/plasma/store.cc index fef697499c41c..74fb21c56d25e 100644 --- a/cpp/src/plasma/store.cc +++ b/cpp/src/plasma/store.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -54,11 +55,8 @@ #include #include -#include - #include "arrow/status.h" #include "arrow/util/config.h" - #include "plasma/common.h" #include "plasma/common_generated.h" #include "plasma/fling.h" diff --git a/cpp/src/plasma/test/client_tests.cc b/cpp/src/plasma/test/client_tests.cc index 03ebc7d53fe87..04e2df39f7c87 100644 --- a/cpp/src/plasma/test/client_tests.cc +++ b/cpp/src/plasma/test/client_tests.cc @@ -16,6 +16,7 @@ // under the License. #include +#include #include #include #include @@ -25,11 +26,8 @@ #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" - #include "plasma/client.h" #include "plasma/common.h" #include "plasma/plasma.h" diff --git a/cpp/src/plasma/test/external_store_tests.cc b/cpp/src/plasma/test/external_store_tests.cc index 2b7ab059feca6..7a9d9bb427e14 100644 --- a/cpp/src/plasma/test/external_store_tests.cc +++ b/cpp/src/plasma/test/external_store_tests.cc @@ -16,6 +16,7 @@ // under the License. #include +#include #include #include #include @@ -25,11 +26,8 @@ #include #include -#include - #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" - #include "plasma/client.h" #include "plasma/common.h" #include "plasma/external_store.h" diff --git a/cpp/src/plasma/test/serialization_tests.cc b/cpp/src/plasma/test/serialization_tests.cc index a9eea7be71a85..12eddddb1f67d 100644 --- a/cpp/src/plasma/test/serialization_tests.cc +++ b/cpp/src/plasma/test/serialization_tests.cc @@ -15,16 +15,14 @@ // specific language governing permissions and limitations // under the License. -#include - +#include #include #include -#include +#include #include "arrow/testing/gtest_util.h" #include "arrow/util/io_util.h" - #include "plasma/common.h" #include "plasma/io.h" #include "plasma/plasma.h" From f98c24cb2a6ca130fbc55a1d706f93ffc01cd448 Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Thu, 23 Dec 2021 15:33:44 +0800 Subject: [PATCH 2/2] disable JNIUTILS Signed-off-by: Yuan Zhou --- cpp/cmake_modules/DefineOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake index 2befafff28669..923b978624801 100644 --- a/cpp/cmake_modules/DefineOptions.cmake +++ b/cpp/cmake_modules/DefineOptions.cmake @@ -238,7 +238,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") define_option(ARROW_JNI "Build the Arrow JNI lib" OFF) - define_option(ARROW_JNIUTIL "Build Arrow JNI utilities" ON) + define_option(ARROW_JNIUTIL "Build Arrow JNI utilities" OFF) define_option(ARROW_JSON "Build Arrow with JSON support (requires RapidJSON)" OFF)