You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/09/27 12:19:56 UTC
[arrow] 17/24: PARQUET-1068: Modify .clang-format to use straight
Google format with 90-character line width
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit d02cd9d0e3db2548bd758199c54f0d1a51b32fb4
Author: Wes McKinney <we...@twosigma.com>
AuthorDate: Mon Jul 31 11:14:52 2017 -0400
PARQUET-1068: Modify .clang-format to use straight Google format with 90-character line width
The main change is horizontal alignment. We should also do a clang-tidy pass sometime to do some further scrubbing
Author: Wes McKinney <we...@twosigma.com>
Closes #375 from wesm/PARQUET-1068 and squashes the following commits:
b81145d [Wes McKinney] Modify .clang-format to use straight Google format with 90-character line width
Change-Id: If8345d1d2a03d785ed41a5848de2c40e4bf53b5b
---
cpp/examples/parquet/reader-writer.cc | 35 ++++++++++++++++++-----------------
cpp/tools/parquet/parquet-scan.cc | 9 ++++++---
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/cpp/examples/parquet/reader-writer.cc b/cpp/examples/parquet/reader-writer.cc
index 210968c..7136b28 100644
--- a/cpp/examples/parquet/reader-writer.cc
+++ b/cpp/examples/parquet/reader-writer.cc
@@ -59,35 +59,36 @@ static std::shared_ptr<GroupNode> SetupSchema() {
parquet::schema::NodeVector fields;
// Create a primitive node named 'boolean_field' with type:BOOLEAN,
// repetition:REQUIRED
- fields.push_back(PrimitiveNode::Make(
- "boolean_field", Repetition::REQUIRED, Type::BOOLEAN, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("boolean_field", Repetition::REQUIRED,
+ Type::BOOLEAN, LogicalType::NONE));
// Create a primitive node named 'int32_field' with type:INT32, repetition:REQUIRED,
// logical type:TIME_MILLIS
- fields.push_back(PrimitiveNode::Make(
- "int32_field", Repetition::REQUIRED, Type::INT32, LogicalType::TIME_MILLIS));
+ fields.push_back(PrimitiveNode::Make("int32_field", Repetition::REQUIRED, Type::INT32,
+ LogicalType::TIME_MILLIS));
// Create a primitive node named 'int64_field' with type:INT64, repetition:REPEATED
- fields.push_back(PrimitiveNode::Make(
- "int64_field", Repetition::REPEATED, Type::INT64, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("int64_field", Repetition::REPEATED, Type::INT64,
+ LogicalType::NONE));
- fields.push_back(PrimitiveNode::Make(
- "int96_field", Repetition::REQUIRED, Type::INT96, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("int96_field", Repetition::REQUIRED, Type::INT96,
+ LogicalType::NONE));
- fields.push_back(PrimitiveNode::Make(
- "float_field", Repetition::REQUIRED, Type::FLOAT, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("float_field", Repetition::REQUIRED, Type::FLOAT,
+ LogicalType::NONE));
- fields.push_back(PrimitiveNode::Make(
- "double_field", Repetition::REQUIRED, Type::DOUBLE, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("double_field", Repetition::REQUIRED, Type::DOUBLE,
+ LogicalType::NONE));
// Create a primitive node named 'ba_field' with type:BYTE_ARRAY, repetition:OPTIONAL
- fields.push_back(PrimitiveNode::Make(
- "ba_field", Repetition::OPTIONAL, Type::BYTE_ARRAY, LogicalType::NONE));
+ fields.push_back(PrimitiveNode::Make("ba_field", Repetition::OPTIONAL, Type::BYTE_ARRAY,
+ LogicalType::NONE));
// Create a primitive node named 'flba_field' with type:FIXED_LEN_BYTE_ARRAY,
// repetition:REQUIRED, field_length = FIXED_LENGTH
fields.push_back(PrimitiveNode::Make("flba_field", Repetition::REQUIRED,
- Type::FIXED_LEN_BYTE_ARRAY, LogicalType::NONE, FIXED_LENGTH));
+ Type::FIXED_LEN_BYTE_ARRAY, LogicalType::NONE,
+ FIXED_LENGTH));
// Create a GroupNode named 'schema' using the primitive nodes defined above
// This GroupNode is the root node of the schema tree
@@ -308,8 +309,8 @@ int main(int argc, char** argv) {
int64_t value;
// Read one value at a time. The number of rows read is returned. values_read
// contains the number of non-null rows
- rows_read = int64_reader->ReadBatch(
- 1, &definition_level, &repetition_level, &value, &values_read);
+ rows_read = int64_reader->ReadBatch(1, &definition_level, &repetition_level,
+ &value, &values_read);
// Ensure only one value is read
assert(rows_read == 1);
// There are no NULL values in the rows written
diff --git a/cpp/tools/parquet/parquet-scan.cc b/cpp/tools/parquet/parquet-scan.cc
index 8ab15a4..5bf2b18 100644
--- a/cpp/tools/parquet/parquet-scan.cc
+++ b/cpp/tools/parquet/parquet-scan.cc
@@ -49,7 +49,9 @@ int main(int argc, char** argv) {
}
} else if ((param = std::strstr(argv[i], BATCH_SIZE_PREFIX.c_str()))) {
value = std::strtok(param + BATCH_SIZE_PREFIX.length(), " ");
- if (value) { batch_size = std::atoi(value); }
+ if (value) {
+ batch_size = std::atoi(value);
+ }
} else {
filename = argv[i];
}
@@ -84,8 +86,9 @@ int main(int argc, char** argv) {
int64_t values_read = 0;
while (col_reader->HasNext()) {
- total_rows[col] += ScanAllValues(batch_size, def_levels.data(),
- rep_levels.data(), values.data(), &values_read, col_reader.get());
+ total_rows[col] +=
+ ScanAllValues(batch_size, def_levels.data(), rep_levels.data(),
+ values.data(), &values_read, col_reader.get());
}
col++;
}