Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh committed May 22, 2024
1 parent acde1ea commit 97e591b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/dataset/file_csv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -507,7 +507,7 @@ Future<> CsvFileWriter::FinishInternal() {
return Status::OK();
}

Result<std::shared_ptr<FragmentScanOptions>> CsvFragmentScanOptions::from(
Result<std::shared_ptr<FragmentScanOptions>> CsvFragmentScanOptions::From(
const std::unordered_map<std::string, std::string>& configs) {
std::shared_ptr<CsvFragmentScanOptions> options =
std::make_shared<CsvFragmentScanOptions>();
Expand All @@ -517,7 +517,7 @@ Result<std::shared_ptr<FragmentScanOptions>> 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<ArrowSchema*>(schema_address);
Expand All @@ -527,7 +527,7 @@ Result<std::shared_ptr<FragmentScanOptions>> 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.");
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/dataset/file_csv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::shared_ptr<FragmentScanOptions>> from(
static Result<std::shared_ptr<FragmentScanOptions>> From(
const std::unordered_map<std::string, std::string>& configs);

using StreamWrapFunc = std::function<Result<std::shared_ptr<io::InputStream>>(
Expand Down
3 changes: 0 additions & 3 deletions cpp/src/arrow/engine/substrait/serde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,6 @@ Result<BoundExpressions> DeserializeExpressions(

Status DeserializeMap(const Buffer& buf,
std::unordered_map<std::string, std::string>& out) {
// ARROW_ASSIGN_OR_RAISE(auto advanced_extension,
// ParseFromBuffer<substrait::extensions::AdvancedExtension>(buf));
// return FromProto(advanced_extension, out);
ARROW_ASSIGN_OR_RAISE(auto literal,
ParseFromBuffer<substrait::Expression::Literal>(buf));
return FromProto(literal, out);
Expand Down
2 changes: 1 addition & 1 deletion cpp/thirdparty/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions java/dataset/src/main/cpp/jni_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 97e591b

Please sign in to comment.