From 97e591ba0fc012f5894419ef297ebbe955ebd7b9 Mon Sep 17 00:00:00 2001 From: Chengcheng Jin Date: Wed, 22 May 2024 11:01:48 +0000 Subject: [PATCH] fix code style --- cpp/src/arrow/dataset/file_csv.cc | 8 ++++---- cpp/src/arrow/dataset/file_csv.h | 2 +- cpp/src/arrow/engine/substrait/serde.cc | 3 --- cpp/thirdparty/versions.txt | 2 +- java/dataset/src/main/cpp/jni_wrapper.cc | 6 +++--- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cpp/src/arrow/dataset/file_csv.cc b/cpp/src/arrow/dataset/file_csv.cc index 145b4ff6e433d..b0ebdb309dfd6 100644 --- a/cpp/src/arrow/dataset/file_csv.cc +++ b/cpp/src/arrow/dataset/file_csv.cc @@ -54,7 +54,7 @@ using internal::SerialExecutor; namespace dataset { namespace { -inline bool parseBool(const std::string& value) { return value == "true" ? true : false; } +inline bool ParseBool(const std::string& value) { return value == "true" ? true : false; } } // namespace struct CsvInspectedFragment : public InspectedFragment { @@ -507,7 +507,7 @@ Future<> CsvFileWriter::FinishInternal() { return Status::OK(); } -Result> CsvFragmentScanOptions::from( +Result> CsvFragmentScanOptions::From( const std::unordered_map& configs) { std::shared_ptr options = std::make_shared(); @@ -517,7 +517,7 @@ Result> CsvFragmentScanOptions::from( if (key == "delimiter") { options->parse_options.delimiter = value.data()[0]; } else if (key == "quoting") { - options->parse_options.quoting = parseBool(value); + options->parse_options.quoting = ParseBool(value); } else if (key == "column_types") { int64_t schema_address = std::stol(value); ArrowSchema* cSchema = reinterpret_cast(schema_address); @@ -527,7 +527,7 @@ Result> CsvFragmentScanOptions::from( column_types[field->name()] = field->type(); } } else if (key == "strings_can_be_null") { - options->convert_options.strings_can_be_null = parseBool(value); + options->convert_options.strings_can_be_null = ParseBool(value); } else { return Status::Invalid("Config " + it.first + " is not supported."); } diff --git a/cpp/src/arrow/dataset/file_csv.h b/cpp/src/arrow/dataset/file_csv.h index 4d2825183fb71..bb80530307ef0 100644 --- a/cpp/src/arrow/dataset/file_csv.h +++ b/cpp/src/arrow/dataset/file_csv.h @@ -85,7 +85,7 @@ class ARROW_DS_EXPORT CsvFileFormat : public FileFormat { struct ARROW_DS_EXPORT CsvFragmentScanOptions : public FragmentScanOptions { std::string type_name() const override { return kCsvTypeName; } - static Result> from( + static Result> From( const std::unordered_map& configs); using StreamWrapFunc = std::function>( diff --git a/cpp/src/arrow/engine/substrait/serde.cc b/cpp/src/arrow/engine/substrait/serde.cc index 02e5c71715aaf..e9c567a9630fa 100644 --- a/cpp/src/arrow/engine/substrait/serde.cc +++ b/cpp/src/arrow/engine/substrait/serde.cc @@ -249,9 +249,6 @@ Result DeserializeExpressions( Status DeserializeMap(const Buffer& buf, std::unordered_map& out) { - // ARROW_ASSIGN_OR_RAISE(auto advanced_extension, - // ParseFromBuffer(buf)); - // return FromProto(advanced_extension, out); ARROW_ASSIGN_OR_RAISE(auto literal, ParseFromBuffer(buf)); return FromProto(literal, out); diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index 893ba83d85d6a..4983f3cee2c2d 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -108,7 +108,7 @@ ARROW_SUBSTRAIT_BUILD_SHA256_CHECKSUM=f989a862f694e7dbb695925ddb7c4ce06aa6c51aca ARROW_S2N_TLS_BUILD_VERSION=v1.3.35 ARROW_S2N_TLS_BUILD_SHA256_CHECKSUM=9d32b26e6bfcc058d98248bf8fc231537e347395dd89cf62bb432b55c5da990d ARROW_THRIFT_BUILD_VERSION=0.16.0 -ARROW_THRIFT_BUILD_SHA256_CHECKSUM=df2931de646a366c2e5962af679018bca2395d586e00ba82d09c0379f14f8e7b +ARROW_THRIFT_BUILD_SHA256_CHECKSUM=f460b5c1ca30d8918ff95ea3eb6291b3951cf518553566088f3f2be8981f6209 ARROW_UCX_BUILD_VERSION=1.12.1 ARROW_UCX_BUILD_SHA256_CHECKSUM=9bef31aed0e28bf1973d28d74d9ac4f8926c43ca3b7010bd22a084e164e31b71 ARROW_UTF8PROC_BUILD_VERSION=v2.7.0 diff --git a/java/dataset/src/main/cpp/jni_wrapper.cc b/java/dataset/src/main/cpp/jni_wrapper.cc index f041b6e9f1b3c..189a52e7d9390 100644 --- a/java/dataset/src/main/cpp/jni_wrapper.cc +++ b/java/dataset/src/main/cpp/jni_wrapper.cc @@ -161,7 +161,7 @@ GetFragmentScanOptions(jint file_format_id, switch (file_format_id) { #ifdef ARROW_CSV case 3: - return arrow::dataset::CsvFragmentScanOptions::from(configs); + return arrow::dataset::CsvFragmentScanOptions::From(configs); #endif default: return arrow::Status::Invalid("Illegal file format id: " ,file_format_id); @@ -690,7 +690,7 @@ JNIEXPORT void JNICALL Java_org_apache_arrow_dataset_jni_JniWrapper_ensureS3Fina /* * Class: org_apache_arrow_dataset_file_JniWrapper * Method: makeFileSystemDatasetFactory - * Signature: (Ljava/lang/String;IILjava/lang/String;Ljava/nio/ByteBuffer)J + * Signature: (Ljava/lang/String;II;Ljava/lang/String;Ljava/nio/ByteBuffer)J */ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_makeFileSystemDatasetFactory( @@ -726,7 +726,7 @@ Java_org_apache_arrow_dataset_file_JniWrapper_makeFileSystemDatasetFactory( /* * Class: org_apache_arrow_dataset_file_JniWrapper * Method: makeFileSystemDatasetFactoryWithFiles - * Signature: ([Ljava/lang/String;IIJ;Ljava/nio/ByteBuffer)J + * Signature: ([Ljava/lang/String;II;Ljava/nio/ByteBuffer)J */ JNIEXPORT jlong JNICALL Java_org_apache_arrow_dataset_file_JniWrapper_makeFileSystemDatasetFactoryWithFiles(