From 39acb40e99bb8e8af5f01d678acefee43d45fbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ljubo=20Nikoli=C4=87?= Date: Wed, 21 Jul 2021 13:45:19 +0200 Subject: [PATCH] add code format check (#196) * add code formating check, apply ParquetSharp.DotSettings, add .editorconfig per project * format code * format new code --- .config/dotnet-tools.json | 12 +++++++ .editorconfig | 29 ++++++++++++++++ .github/workflows/ci.yml | 21 ++++++++++++ ParquetSharp.DotSettings | 7 ++++ csharp.benchmark/.editorconfig | 29 ++++++++++++++++ csharp.benchmark/DecimalRead.cs | 4 +-- csharp.benchmark/DecimalWrite.cs | 2 +- csharp.benchmark/FloatTimeSeriesBase.cs | 2 +- csharp.benchmark/FloatTimeSeriesWrite.cs | 2 +- .../ParquetSharp.Benchmark.csproj | 2 +- csharp.benchmark/Program.cs | 8 ++--- .../Properties/launchSettings.json | 2 +- csharp.test/.editorconfig | 29 ++++++++++++++++ csharp.test/ParquetSharp.Test.csproj | 2 +- csharp.test/PhysicalValueGetter.cs | 8 ++--- csharp.test/PhysicalValueSetter.cs | 2 +- csharp.test/Program.cs | 3 +- csharp.test/Properties/launchSettings.json | 2 +- csharp.test/TestAadPrefixVerifier.cs | 2 +- csharp.test/TestBuffer.cs | 2 +- csharp.test/TestByteArrayReaderCache.cs | 2 +- csharp.test/TestColumn.cs | 2 +- csharp.test/TestColumnPath.cs | 4 +-- csharp.test/TestColumnReader.cs | 4 +-- csharp.test/TestColumnWriter.cs | 4 +-- csharp.test/TestDecimal128.cs | 4 +-- csharp.test/TestEncryption.cs | 20 +++++------ csharp.test/TestLogicalTypeFactory.cs | 7 ++-- csharp.test/TestLogicalTypeRoundtrip.cs | 12 +++---- csharp.test/TestMemoryLeaks.cs | 2 +- csharp.test/TestMemoryPool.cs | 2 +- csharp.test/TestParquetFileWriter.cs | 10 +++--- csharp.test/TestPhysicalTypeRoundtrip.cs | 12 +++---- csharp.test/TestRowOrientedParquetFile.cs | 17 +++++----- csharp.test/TestWriterProperties.cs | 6 ++-- csharp/.editorconfig | 29 ++++++++++++++++ csharp/ApplicationVersion.cs | 2 +- csharp/ColumnChunkMetaData.cs | 8 ++--- csharp/ColumnCryptoMetaData.cs | 10 +++--- csharp/ColumnDescriptor.cs | 2 +- csharp/ColumnOrder.cs | 3 +- csharp/ColumnReader.cs | 32 ++++++++--------- csharp/ColumnWriter.cs | 34 +++++++++---------- csharp/Compression.cs | 1 - csharp/DateTimeNanos.cs | 2 +- csharp/Decimal128.cs | 2 +- csharp/Encoding.cs | 3 +- csharp/ExceptionInfo.cs | 3 +- csharp/FileDecryptionPropertiesBuilder.cs | 6 ++-- csharp/FileMetaData.cs | 2 +- csharp/IColumnDescriptorVisitor.cs | 3 +- csharp/IColumnReaderVisitor.cs | 1 - csharp/IColumnWriterVisitor.cs | 3 +- csharp/ILogicalColumnReaderVisitor.cs | 3 +- csharp/ILogicalColumnWriterVisitor.cs | 3 +- csharp/IO/BufferOutputStream.cs | 2 +- csharp/IO/ManagedRandomAccessFile.cs | 2 +- csharp/IO/RandomAccessFile.cs | 2 +- csharp/IO/ResizableBuffer.cs | 3 +- csharp/InternalsVisibleTo.cs | 2 +- csharp/KeyValueMetadata.cs | 2 +- csharp/LogicalColumnReader.cs | 26 +++++++------- csharp/LogicalColumnWriter.cs | 30 ++++++++-------- csharp/LogicalReadConverterFactory.cs | 5 ++- csharp/LogicalType.cs | 3 +- csharp/LogicalWriteConverterFactory.cs | 3 +- csharp/MemoryPool.cs | 2 +- csharp/ParquetCipher.cs | 5 ++- csharp/ParquetDll.cs | 1 - csharp/ParquetException.cs | 3 +- csharp/ParquetFileReader.cs | 2 +- csharp/ParquetFileWriter.cs | 34 +++++++++---------- csharp/ParquetHandle.cs | 2 +- csharp/ParquetSharp.csproj | 2 +- csharp/ParquetSharp.targets | 3 +- csharp/ParquetVersion.cs | 3 +- csharp/PhysicalType.cs | 3 +- csharp/ReaderProperties.cs | 4 +-- csharp/Repetition.cs | 3 +- csharp/RowGroupMetaData.cs | 2 +- csharp/RowGroupReader.cs | 2 +- csharp/RowOriented/ParquetFile.cs | 2 +- csharp/RowOriented/ParquetRowWriter.cs | 2 +- csharp/Schema/ColumnPath.cs | 2 +- csharp/Schema/GroupNode.cs | 4 +-- csharp/Schema/Node.cs | 2 +- csharp/Schema/NodeType.cs | 3 +- csharp/Schema/PrimitiveNode.cs | 8 ++--- csharp/SchemaDescriptor.cs | 4 +-- csharp/SortOrder.cs | 3 +- csharp/StringUtil.cs | 4 +-- csharp/TimeUnit.cs | 3 +- csharp/WriterProperties.cs | 2 +- 93 files changed, 377 insertions(+), 243 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 .editorconfig create mode 100644 ParquetSharp.DotSettings create mode 100644 csharp.benchmark/.editorconfig create mode 100644 csharp.test/.editorconfig create mode 100644 csharp/.editorconfig diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..4b777901 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "jetbrains.resharper.globaltools": { + "version": "2021.1.3", + "commands": [ + "jb" + ] + } + } +} \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..31376257 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,29 @@ +[*.{csproj,json,targets}] +indent_size = 2 +resharper_xml_wrap_tags_and_pi = false + +[*.cs] +csharp_new_line_before_members_in_object_initializers = false +csharp_preserve_single_line_blocks = true +resharper_blank_lines_after_block_statements = 0 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_single_line_type = 0 +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_insert_final_newline = true +resharper_csharp_wrap_lines = false +resharper_empty_block_style = multiline +resharper_keep_existing_embedded_block_arrangement = false +resharper_keep_existing_enum_arrangement = false +resharper_max_attribute_length_for_same_line = 70 +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_expr_accessor_on_single_line = true +resharper_place_expr_method_on_single_line = true +resharper_place_expr_property_on_single_line = true +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = true +resharper_place_simple_initializer_on_single_line = false +resharper_remove_blank_lines_near_braces_in_code = false +resharper_remove_blank_lines_near_braces_in_declarations = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_object_and_collection_initializer_style = chop_always \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc6eee06..1607274b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,27 @@ jobs: # Note that vcpkg dependencies takes the majority of the build time. # We cache them using GitHub Actions cache and export, making the scripts below a bit more complex. + check-format: + if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.dotnet_5_version }} + - name: Code formating check + run: | + dotnet tool restore + dotnet jb cleanupcode "csharp" "csharp.test" "csharp.benchmark" --profile="Built-in: Reformat Code" --settings="ParquetSharp.DotSettings" --dotnetcoresdk=${{ env.dotnet_5_version }} --verbosity=WARN + + files=($(git diff --name-only)) + if [ ${#files[@]} -gt 0 ] + then + for file in $files; do echo "::error file=$file::Code format check failed"; done + exit 1 + fi # Build everything on all platorms (thus testing the developer workflow). # Upload the native shared libraries as artifacts. diff --git a/ParquetSharp.DotSettings b/ParquetSharp.DotSettings new file mode 100644 index 00000000..17996746 --- /dev/null +++ b/ParquetSharp.DotSettings @@ -0,0 +1,7 @@ + + False + True + NEVER + NEVER + NEVER + \ No newline at end of file diff --git a/csharp.benchmark/.editorconfig b/csharp.benchmark/.editorconfig new file mode 100644 index 00000000..31376257 --- /dev/null +++ b/csharp.benchmark/.editorconfig @@ -0,0 +1,29 @@ +[*.{csproj,json,targets}] +indent_size = 2 +resharper_xml_wrap_tags_and_pi = false + +[*.cs] +csharp_new_line_before_members_in_object_initializers = false +csharp_preserve_single_line_blocks = true +resharper_blank_lines_after_block_statements = 0 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_single_line_type = 0 +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_insert_final_newline = true +resharper_csharp_wrap_lines = false +resharper_empty_block_style = multiline +resharper_keep_existing_embedded_block_arrangement = false +resharper_keep_existing_enum_arrangement = false +resharper_max_attribute_length_for_same_line = 70 +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_expr_accessor_on_single_line = true +resharper_place_expr_method_on_single_line = true +resharper_place_expr_property_on_single_line = true +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = true +resharper_place_simple_initializer_on_single_line = false +resharper_remove_blank_lines_near_braces_in_code = false +resharper_remove_blank_lines_near_braces_in_declarations = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_object_and_collection_initializer_style = chop_always \ No newline at end of file diff --git a/csharp.benchmark/DecimalRead.cs b/csharp.benchmark/DecimalRead.cs index 2b712a42..3aafc2fc 100644 --- a/csharp.benchmark/DecimalRead.cs +++ b/csharp.benchmark/DecimalRead.cs @@ -21,10 +21,10 @@ public DecimalRead() { var n = rand.Next(); var sign = rand.NextDouble() < 0.5 ? -1M : +1M; - return sign * ((decimal)n * n * n) / 1000M; + return sign * ((decimal) n * n * n) / 1000M; }).ToArray(); - using (var fileWriter = new ParquetFileWriter(Filename, new Column[] { new Column("Value", LogicalType.Decimal(precision: 29, scale: 3)) })) + using (var fileWriter = new ParquetFileWriter(Filename, new Column[] {new Column("Value", LogicalType.Decimal(precision: 29, scale: 3))})) { using var rowGroupWriter = fileWriter.AppendRowGroup(); using var valueWriter = rowGroupWriter.NextColumn().LogicalWriter(); diff --git a/csharp.benchmark/DecimalWrite.cs b/csharp.benchmark/DecimalWrite.cs index 851e35bb..b6918a20 100644 --- a/csharp.benchmark/DecimalWrite.cs +++ b/csharp.benchmark/DecimalWrite.cs @@ -21,7 +21,7 @@ public DecimalWrite() { var n = rand.Next(); var sign = rand.NextDouble() < 0.5 ? -1M : +1M; - return sign * ((decimal)n * n * n) / 1000M; + return sign * ((decimal) n * n * n) / 1000M; }).ToArray(); Console.WriteLine("Generated {0:N0} rows in {1:N2} sec", _values.Length, timer.Elapsed.TotalSeconds); diff --git a/csharp.benchmark/FloatTimeSeriesBase.cs b/csharp.benchmark/FloatTimeSeriesBase.cs index 02b56541..edcc4b81 100644 --- a/csharp.benchmark/FloatTimeSeriesBase.cs +++ b/csharp.benchmark/FloatTimeSeriesBase.cs @@ -30,7 +30,7 @@ protected static (DateTime[] dates, int[] objectIds, float[][] values, int numRo .OrderBy(i => i) .ToArray(); - var values = dates.Select(d => objectIds.Select(o => (float)rand.NextDouble()).ToArray()).ToArray(); + var values = dates.Select(d => objectIds.Select(o => (float) rand.NextDouble()).ToArray()).ToArray(); var numRows = values.Select(v => v.Length).Aggregate(0, (sum, l) => sum + l); return (dates, objectIds, values, numRows); diff --git a/csharp.benchmark/FloatTimeSeriesWrite.cs b/csharp.benchmark/FloatTimeSeriesWrite.cs index 94f8fe3d..2e78c4ed 100644 --- a/csharp.benchmark/FloatTimeSeriesWrite.cs +++ b/csharp.benchmark/FloatTimeSeriesWrite.cs @@ -66,7 +66,7 @@ public long CsvGz() return new FileInfo("float_timeseries.csv.gz").Length; } - + [Benchmark(Baseline = true, Description = "Baseline")] public long Parquet() { diff --git a/csharp.benchmark/ParquetSharp.Benchmark.csproj b/csharp.benchmark/ParquetSharp.Benchmark.csproj index 3edd5033..d25ada6f 100644 --- a/csharp.benchmark/ParquetSharp.Benchmark.csproj +++ b/csharp.benchmark/ParquetSharp.Benchmark.csproj @@ -21,4 +21,4 @@ - + \ No newline at end of file diff --git a/csharp.benchmark/Program.cs b/csharp.benchmark/Program.cs index dbf05b02..4e6e9c52 100644 --- a/csharp.benchmark/Program.cs +++ b/csharp.benchmark/Program.cs @@ -17,9 +17,9 @@ public static int Main() Console.WriteLine("Working directory: {0}", Environment.CurrentDirectory); var config = DefaultConfig - .Instance - .AddColumn(new SizeInBytesColumn()) - .WithOptions(ConfigOptions.Default | ConfigOptions.StopOnFirstError) + .Instance + .AddColumn(new SizeInBytesColumn()) + .WithOptions(ConfigOptions.Default | ConfigOptions.StopOnFirstError) ; var summaries = BenchmarkRunner.Run(new[] @@ -32,7 +32,7 @@ public static int Main() // Re-print to the console all the summaries. var logger = ConsoleLogger.Default; - + logger.WriteLine(); foreach (var summary in summaries) diff --git a/csharp.benchmark/Properties/launchSettings.json b/csharp.benchmark/Properties/launchSettings.json index 2e9721c0..2b909e31 100644 --- a/csharp.benchmark/Properties/launchSettings.json +++ b/csharp.benchmark/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "ParquetCppSharp.Test": { "commandName": "Project", - "nativeDebugging": true + "nativeDebugging": true } } } \ No newline at end of file diff --git a/csharp.test/.editorconfig b/csharp.test/.editorconfig new file mode 100644 index 00000000..31376257 --- /dev/null +++ b/csharp.test/.editorconfig @@ -0,0 +1,29 @@ +[*.{csproj,json,targets}] +indent_size = 2 +resharper_xml_wrap_tags_and_pi = false + +[*.cs] +csharp_new_line_before_members_in_object_initializers = false +csharp_preserve_single_line_blocks = true +resharper_blank_lines_after_block_statements = 0 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_single_line_type = 0 +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_insert_final_newline = true +resharper_csharp_wrap_lines = false +resharper_empty_block_style = multiline +resharper_keep_existing_embedded_block_arrangement = false +resharper_keep_existing_enum_arrangement = false +resharper_max_attribute_length_for_same_line = 70 +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_expr_accessor_on_single_line = true +resharper_place_expr_method_on_single_line = true +resharper_place_expr_property_on_single_line = true +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = true +resharper_place_simple_initializer_on_single_line = false +resharper_remove_blank_lines_near_braces_in_code = false +resharper_remove_blank_lines_near_braces_in_declarations = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_object_and_collection_initializer_style = chop_always \ No newline at end of file diff --git a/csharp.test/ParquetSharp.Test.csproj b/csharp.test/ParquetSharp.Test.csproj index 84e0fa16..7ee9c95f 100644 --- a/csharp.test/ParquetSharp.Test.csproj +++ b/csharp.test/ParquetSharp.Test.csproj @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/csharp.test/PhysicalValueGetter.cs b/csharp.test/PhysicalValueGetter.cs index 0e263b25..a288ef81 100644 --- a/csharp.test/PhysicalValueGetter.cs +++ b/csharp.test/PhysicalValueGetter.cs @@ -10,7 +10,7 @@ public PhysicalValueGetter(long numValues) _numValues = numValues; } - public (Array values, short[] definitionLevels, short[] repetitionLevels) OnColumnReader(ColumnReader columnReader) + public (Array values, short[] definitionLevels, short[] repetitionLevels) OnColumnReader(ColumnReader columnReader) where TValue : unmanaged { var values = new TValue[_numValues]; @@ -22,11 +22,11 @@ public PhysicalValueGetter(long numValues) while (columnReader.HasNext) { var levelsRead = columnReader.ReadBatch( - _numValues - totalLevels, defLevels.AsSpan(totalLevels), repLevels.AsSpan(totalLevels), values.AsSpan(totalValues), + _numValues - totalLevels, defLevels.AsSpan(totalLevels), repLevels.AsSpan(totalLevels), values.AsSpan(totalValues), out var valuesRead); - totalValues += (int)valuesRead; - totalLevels += (int)levelsRead; + totalValues += (int) valuesRead; + totalLevels += (int) levelsRead; } return (values.Where((v, i) => i < totalValues).ToArray(), defLevels.ToArray(), repLevels.ToArray()); diff --git a/csharp.test/PhysicalValueSetter.cs b/csharp.test/PhysicalValueSetter.cs index 65c97b98..fdac0d13 100644 --- a/csharp.test/PhysicalValueSetter.cs +++ b/csharp.test/PhysicalValueSetter.cs @@ -10,7 +10,7 @@ public ValueSetter(Array values, (int begin, int end)? range = null) _range = range ?? (0, values.Length); } - public Array OnColumnWriter(ColumnWriter columnWriter) + public Array OnColumnWriter(ColumnWriter columnWriter) where TValue : unmanaged { var values = (TValue[]) _values; diff --git a/csharp.test/Program.cs b/csharp.test/Program.cs index cad74adc..f64b53f4 100644 --- a/csharp.test/Program.cs +++ b/csharp.test/Program.cs @@ -1,5 +1,4 @@ - -using System; +using System; using System.Runtime.ExceptionServices; namespace ParquetSharp.Test diff --git a/csharp.test/Properties/launchSettings.json b/csharp.test/Properties/launchSettings.json index 2e9721c0..2b909e31 100644 --- a/csharp.test/Properties/launchSettings.json +++ b/csharp.test/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "ParquetCppSharp.Test": { "commandName": "Project", - "nativeDebugging": true + "nativeDebugging": true } } } \ No newline at end of file diff --git a/csharp.test/TestAadPrefixVerifier.cs b/csharp.test/TestAadPrefixVerifier.cs index 01e94970..371ab4d3 100644 --- a/csharp.test/TestAadPrefixVerifier.cs +++ b/csharp.test/TestAadPrefixVerifier.cs @@ -54,4 +54,4 @@ public TestVerifier(string exceptionMessage) public override void Verify(string aadPrefix) => throw new ArgumentException(ExceptionMessage); } } -} \ No newline at end of file +} diff --git a/csharp.test/TestBuffer.cs b/csharp.test/TestBuffer.cs index acae474f..8a0aec5f 100644 --- a/csharp.test/TestBuffer.cs +++ b/csharp.test/TestBuffer.cs @@ -62,7 +62,7 @@ public static void TestBufferOutputStreamFinish() { var expected = Enumerable.Range(0, 100).ToArray(); using var outStream = new BufferOutputStream(); - + // Write out a single column using (var fileWriter = new ParquetFileWriter(outStream, new Column[] {new Column("int_field")})) { diff --git a/csharp.test/TestByteArrayReaderCache.cs b/csharp.test/TestByteArrayReaderCache.cs index 45ae3f30..4cd52b93 100644 --- a/csharp.test/TestByteArrayReaderCache.cs +++ b/csharp.test/TestByteArrayReaderCache.cs @@ -54,7 +54,7 @@ public static void TestReadingDuplicateStrings([Values(true, false)] bool enable // When reading back the file, we expect the duplicate strings to point to the same memory instances. Assert.That( - readValues.Distinct(new StringReferenceComparer()).Count(), + readValues.Distinct(new StringReferenceComparer()).Count(), enableDictionary ? Is.EqualTo(100) : Is.EqualTo(numRows)); } diff --git a/csharp.test/TestColumn.cs b/csharp.test/TestColumn.cs index ef67e22d..206a9816 100644 --- a/csharp.test/TestColumn.cs +++ b/csharp.test/TestColumn.cs @@ -47,7 +47,7 @@ public static void TestUnsupportedType() [Test] public static void TestUnsupportedLogicalTypeOverride() { - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => new Column("DateTime", LogicalType.Json()).CreateSchemaNode()); Assert.That( diff --git a/csharp.test/TestColumnPath.cs b/csharp.test/TestColumnPath.cs index d86d03cc..f0fbbb43 100644 --- a/csharp.test/TestColumnPath.cs +++ b/csharp.test/TestColumnPath.cs @@ -19,7 +19,7 @@ public static void TestDotRepresentations() Assert.AreEqual(new[] {"root", "part0", "part1"}, p1.ToDotVector()); using var p2 = p0.Extend("part2"); - + Assert.AreEqual("root.part0.part1.part2", p2.ToDotString()); } @@ -85,7 +85,7 @@ public static void TestNodeRepresentationUtf8() Assert.AreEqual("", schema.Path.ToDotString()); Assert.AreEqual(name + "", schema.Field(0).Path.ToDotString()); - Assert.AreEqual(name+ ".list", ((GroupNode) schema.Field(0)).Field(0).Path.ToDotString()); + Assert.AreEqual(name + ".list", ((GroupNode) schema.Field(0)).Field(0).Path.ToDotString()); Assert.AreEqual(name + ".list.item", ((GroupNode) ((GroupNode) schema.Field(0)).Field(0)).Field(0).Path.ToDotString()); } } diff --git a/csharp.test/TestColumnReader.cs b/csharp.test/TestColumnReader.cs index b832b6ea..69a15e08 100644 --- a/csharp.test/TestColumnReader.cs +++ b/csharp.test/TestColumnReader.cs @@ -47,9 +47,9 @@ public static void TestSkip() { const int numRows = 11; - var schemaColumns = new Column[] { new Column("int32_field") }; + var schemaColumns = new Column[] {new Column("int32_field")}; var values = Enumerable.Range(0, numRows).ToArray(); - + using var buffer = new ResizableBuffer(); using (var outStream = new BufferOutputStream(buffer)) diff --git a/csharp.test/TestColumnWriter.cs b/csharp.test/TestColumnWriter.cs index 3f39fe57..ba71459d 100644 --- a/csharp.test/TestColumnWriter.cs +++ b/csharp.test/TestColumnWriter.cs @@ -17,7 +17,7 @@ public static void TestWriteBatchWithNullOptionalField() using var writer = new ParquetFileWriter(outStream, new Column[] {new Column("int32?")}); using var rowGroupWriter = writer.AppendRowGroup(); using var colWriter = (ColumnWriter) rowGroupWriter.NextColumn(); - + var defLevels = new short[] {1, 0, 1}; var values = new[] {1, 2}; @@ -43,7 +43,7 @@ public static void TestUnsupportedType() using var buffer = new ResizableBuffer(); using var outStream = new BufferOutputStream(buffer); - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => new ParquetFileWriter(outStream, new Column[] {new Column("unsupported")})); Assert.AreEqual("unsupported logical type System.Object", exception?.Message); diff --git a/csharp.test/TestDecimal128.cs b/csharp.test/TestDecimal128.cs index d048933d..41c26cd0 100644 --- a/csharp.test/TestDecimal128.cs +++ b/csharp.test/TestDecimal128.cs @@ -17,7 +17,7 @@ internal static class TestDecimal128 [TestCaseSource(nameof(Scales))] public static void TestRoundTrip(int scale) { - var list = new List{0, 1}; + var list = new List {0, 1}; for (int i = 0; i != 28; ++i) { list.Add(list.Last() * 10); @@ -65,7 +65,7 @@ public static void TestAgainstThirdParty() var columns = new Column[] {new Column("Decimal", LogicalType.Decimal(precision: 29, scale: 3))}; var values = Enumerable.Range(0, 10_000) .Select(i => ((decimal) i * i * i) / 1000 - 10) - .Concat(new [] {decimal.MinValue / 1000, decimal.MaxValue / 1000}) + .Concat(new[] {decimal.MinValue / 1000, decimal.MaxValue / 1000}) .ToArray(); using var buffer = new ResizableBuffer(); diff --git a/csharp.test/TestEncryption.cs b/csharp.test/TestEncryption.cs index a69ee033..1f31486e 100644 --- a/csharp.test/TestEncryption.cs +++ b/csharp.test/TestEncryption.cs @@ -136,7 +136,7 @@ public static void TestEncryptJustOneColumn() { using var fileReader = new ParquetFileReader(input); using var groupReader = fileReader.RowGroup(0); - + var numRows = (int) groupReader.MetaData.NumRows; using (var idReader = groupReader.Column(0).LogicalReader()) @@ -185,7 +185,7 @@ private static FileEncryptionProperties CreateEncryptJustColumnsProperties() using var builder = new FileEncryptionPropertiesBuilder(Key0); using var col1 = new ColumnEncryptionPropertiesBuilder("Value"); using var col0 = new ColumnEncryptionPropertiesBuilder("Id"); - + return builder .FooterKeyMetadata("Key0") .SetPlaintextFooter() @@ -201,7 +201,7 @@ private static FileEncryptionProperties CreateEncryptJustOneColumnProperties() { using var builder = new FileEncryptionPropertiesBuilder(Key0); using var col1 = new ColumnEncryptionPropertiesBuilder("Value"); - + return builder .FooterKeyMetadata("Key0") .SetPlaintextFooter() @@ -217,7 +217,7 @@ private static FileEncryptionProperties CreateEncryptJustOneColumnProperties() private static FileDecryptionProperties CreateDecryptAllSameKeyProperties() { using var builder = new FileDecryptionPropertiesBuilder(); - + return builder .FooterKey(Key0) .Build(); @@ -226,7 +226,7 @@ private static FileDecryptionProperties CreateDecryptAllSameKeyProperties() private static FileDecryptionProperties CreateDecryptWithKeyRetrieverProperties() { using var builder = new FileDecryptionPropertiesBuilder(); - + return builder .KeyRetriever(new TestRetriever()) .Build(); @@ -234,7 +234,7 @@ private static FileDecryptionProperties CreateDecryptWithKeyRetrieverProperties( private static void AssertEncryptionRoundtrip( Func createFileEncryptionProperties, - Func createFileDecryptionProperties, + Func createFileDecryptionProperties, Action? onGroupReader = null) { using var buffer = new ResizableBuffer(); @@ -257,7 +257,7 @@ private static void WriteParquetFile(BufferOutputStream output, FileEncryptionPr using var writerProperties = CreateWriterProperties(fileEncryptionProperties); using var fileWriter = new ParquetFileWriter(output, Columns, writerProperties); using var groupWriter = fileWriter.AppendRowGroup(); - + using (var idWriter = groupWriter.NextColumn().LogicalWriter()) { idWriter.WriteBatch(Ids); @@ -274,7 +274,7 @@ private static void ReadParquetFile(FileDecryptionProperties? fileDecryptionProp using var readerProperties = CreateReaderProperties(fileDecryptionProperties); using var fileReader = new ParquetFileReader(input, readerProperties); using var groupReader = fileReader.RowGroup(0); - + var metaData = groupReader.MetaData; var numRows = (int) metaData.NumRows; @@ -294,7 +294,7 @@ private static void ReadParquetFile(FileDecryptionProperties? fileDecryptionProp private static WriterProperties CreateWriterProperties(FileEncryptionProperties? fileEncryptionProperties) { using var builder = new WriterPropertiesBuilder(); - + return builder .Compression(Compression.Snappy) .Encryption(fileEncryptionProperties) @@ -328,7 +328,7 @@ public override byte[] GetKey(string keyMetadata) public static readonly Column[] Columns = { - new Column("Id"), + new Column("Id"), new Column("Value") }; diff --git a/csharp.test/TestLogicalTypeFactory.cs b/csharp.test/TestLogicalTypeFactory.cs index 7b731bf9..2e2cbf32 100644 --- a/csharp.test/TestLogicalTypeFactory.cs +++ b/csharp.test/TestLogicalTypeFactory.cs @@ -59,7 +59,7 @@ public static void TestWriteNoTypeFactory() // Test that we cannot create a writer using a custom type without providing a factory. using var buffer = new ResizableBuffer(); using var output = new BufferOutputStream(buffer); - + var exception = Assert.Throws(() => { using var fileWriter = new ParquetFileWriter(output, new Column[] {new Column("value")}); @@ -358,7 +358,7 @@ private static void CheckWrittenValues(ResizableBuffer buffer, TValue[] using var groupReader = fileReader.RowGroup(0); using var columnReader = groupReader.Column(0).LogicalReader(); - var values = columnReader.ReadAll(checked((int)groupReader.MetaData.NumRows)); + var values = columnReader.ReadAll(checked((int) groupReader.MetaData.NumRows)); Assert.AreEqual(expected, values); } @@ -471,7 +471,8 @@ public override Delegate GetConverter(ColumnDescriptor colu private static readonly VolumeInDollars[] CustomValues = {new(1f), new(2f), new(3f)}; private static readonly float[][] ArrayValues = {new[] {1f, 2f, 3f}, new[] {4f}}; - private static readonly VolumeInDollars[][] ArrayCustomValues = { + private static readonly VolumeInDollars[][] ArrayCustomValues = + { new[] {new VolumeInDollars(1f), new VolumeInDollars(2f), new VolumeInDollars(3f)}, new[] {new VolumeInDollars(4f)} }; diff --git a/csharp.test/TestLogicalTypeRoundtrip.cs b/csharp.test/TestLogicalTypeRoundtrip.cs index e6be3bd3..208da2d9 100644 --- a/csharp.test/TestLogicalTypeRoundtrip.cs +++ b/csharp.test/TestLogicalTypeRoundtrip.cs @@ -18,7 +18,7 @@ public static void TestRoundTrip( ) { var expectedColumns = CreateExpectedColumns(); - var schemaColumns = expectedColumns + var schemaColumns = expectedColumns .Select(c => new Column(c.Values.GetType().GetElementType() ?? throw new InvalidOperationException(), c.Name, c.LogicalTypeOverride)) .ToArray(); @@ -72,7 +72,7 @@ public static void TestRoundTripBuffered( using var rowGroupWriter = fileWriter.AppendBufferedRowGroup(); const int rangeLength = 9; - + for (int r = 0; r < NumRows; r += rangeLength) { for (var i = 0; i < expectedColumns.Length; i++) @@ -185,7 +185,7 @@ public static void TestBigFileBufferedRowGroup() // Test a large amount of rows with a buffered row group to uncover any particular issue. const int numBatches = 64; const int batchSize = 8192; - + using var buffer = new ResizableBuffer(); using (var output = new BufferOutputStream(buffer)) @@ -236,7 +236,7 @@ public static void TestBigFileBufferedRowGroup() var startIndex = batchSize * batchIndex; Assert.AreEqual(Enumerable.Range(startIndex, batchSize).ToArray(), col0.ReadAll(batchSize)); - Assert.AreEqual(Enumerable.Range(startIndex, batchSize).Select(i => (double)i).ToArray(), col1.ReadAll(batchSize)); + Assert.AreEqual(Enumerable.Range(startIndex, batchSize).Select(i => (double) i).ToArray(), col1.ReadAll(batchSize)); Assert.AreEqual(Enumerable.Range(startIndex, batchSize).Select(i => i.ToString()).ToArray(), col2.ReadAll(batchSize)); Assert.AreEqual(Enumerable.Range(startIndex, batchSize).Select(i => i % 2 == 0).ToArray(), col3.ReadAll(batchSize)); } @@ -604,7 +604,7 @@ private static ExpectedColumn[] CreateExpectedColumns() Length = 16, Values = Enumerable.Range(0, NumRows).Select(i => ((decimal) i * i * i) / 1000 - 10).ToArray(), Min = -10m, - Max = ((NumRows-1m) * (NumRows-1m) * (NumRows-1m)) / 1000 - 10, + Max = ((NumRows - 1m) * (NumRows - 1m) * (NumRows - 1m)) / 1000 - 10, Converter = v => LogicalRead.ToDecimal((FixedLenByteArray) v, 3) }, new ExpectedColumn @@ -618,7 +618,7 @@ private static ExpectedColumn[] CreateExpectedColumns() NullCount = (NumRows + 10) / 11, NumValues = NumRows - (NumRows + 10) / 11, Min = -9.999m, - Max = ((NumRows-1m) * (NumRows-1m) * (NumRows-1m)) / 1000 - 10, + Max = ((NumRows - 1m) * (NumRows - 1m) * (NumRows - 1m)) / 1000 - 10, Converter = v => LogicalRead.ToDecimal((FixedLenByteArray) v, 3) }, new ExpectedColumn diff --git a/csharp.test/TestMemoryLeaks.cs b/csharp.test/TestMemoryLeaks.cs index f27c0577..a9a95fe7 100644 --- a/csharp.test/TestMemoryLeaks.cs +++ b/csharp.test/TestMemoryLeaks.cs @@ -155,7 +155,7 @@ private static (DateTime[] dates, int[] objectIds, float[][] values) CreateFloat .OrderBy(i => i) .ToArray(); - var values = dates.Select(d => objectIds.Select(o => (float)rand.NextDouble()).ToArray()).ToArray(); + var values = dates.Select(d => objectIds.Select(o => (float) rand.NextDouble()).ToArray()).ToArray(); return (dates, objectIds, values); } diff --git a/csharp.test/TestMemoryPool.cs b/csharp.test/TestMemoryPool.cs index 3639296b..505ac440 100644 --- a/csharp.test/TestMemoryPool.cs +++ b/csharp.test/TestMemoryPool.cs @@ -18,7 +18,7 @@ public static void TestDefaultMemoryPool() using (var buffer = new ResizableBuffer()) { using var stream = new BufferOutputStream(buffer); - using var fileWriter = new ParquetFileWriter(stream, new Column[] { new Column("Index") }); + using var fileWriter = new ParquetFileWriter(stream, new Column[] {new Column("Index")}); Assert.Greater(pool.BytesAllocated, 0); Assert.Greater(pool.MaxMemory, 0); diff --git a/csharp.test/TestParquetFileWriter.cs b/csharp.test/TestParquetFileWriter.cs index be59c33f..0c0d953a 100644 --- a/csharp.test/TestParquetFileWriter.cs +++ b/csharp.test/TestParquetFileWriter.cs @@ -27,7 +27,7 @@ public static void TestProperties() var columns = new Column[] { - new Column("Index"), + new Column("Index"), new Column("Value") }; @@ -63,7 +63,7 @@ public static void TestProperties() using (var writer = groupWriter.NextColumn().LogicalWriter()) { - writer.WriteBatch(new[] { 1, 2, 3, 4, 5, 6 }); + writer.WriteBatch(new[] {1, 2, 3, 4, 5, 6}); } Assert.AreEqual(0, fileWriter.NumRows); @@ -72,7 +72,7 @@ public static void TestProperties() using (var writer = groupWriter.NextColumn().LogicalWriter()) { - writer.WriteBatch(new[] { 1f, 2f, 3f, 4f, 5f, 6f }); + writer.WriteBatch(new[] {1f, 2f, 3f, 4f, 5f, 6f}); } Assert.AreEqual(0, fileWriter.NumRows); @@ -118,7 +118,7 @@ public static void TestDisposeExceptionSafety_ParquetFileWriter() using var buffer = new ResizableBuffer(); using var outStream = new BufferOutputStream(buffer); using var fileWriter = new ParquetFileWriter(outStream, new Column[] {new Column("Index"), new Column("Value")}); - + throw new Exception("this is the expected message"); }); @@ -148,7 +148,7 @@ public static void TestDisposeExceptionSafety_ColumnWriter() { using var buffer = new ResizableBuffer(); using var outStream = new BufferOutputStream(buffer); - using var fileWriter = new ParquetFileWriter(outStream, new Column[] { new Column("Index"), new Column("Value") }); + using var fileWriter = new ParquetFileWriter(outStream, new Column[] {new Column("Index"), new Column("Value")}); using var groupWriter = fileWriter.AppendRowGroup(); using (var writer = groupWriter.NextColumn().LogicalWriter()) diff --git a/csharp.test/TestPhysicalTypeRoundtrip.cs b/csharp.test/TestPhysicalTypeRoundtrip.cs index 0d5dcec7..1d2deec1 100644 --- a/csharp.test/TestPhysicalTypeRoundtrip.cs +++ b/csharp.test/TestPhysicalTypeRoundtrip.cs @@ -42,7 +42,7 @@ private static void TestRoundTrip(ExpectedColumn[] expectedColumns, bool useDict { var schema = CreateSchema(expectedColumns); var writerProperties = CreateWriterProperties(expectedColumns, useDictionaryEncoding); - var keyValueMetadata = new Dictionary { { "case", "Test" }, { "Awesome", "true" } }; + var keyValueMetadata = new Dictionary {{"case", "Test"}, {"Awesome", "true"}}; using var buffer = new ResizableBuffer(); @@ -73,7 +73,7 @@ private static void TestRoundTripBuffered(ExpectedColumn[] expectedColumns, bool var schema = CreateSchema(expectedColumns); var writerProperties = CreateWriterProperties(expectedColumns, useDictionaryEncoding); - var keyValueMetadata = new Dictionary { { "case", "Test" }, { "Awesome", "true" } }; + var keyValueMetadata = new Dictionary {{"case", "Test"}, {"Awesome", "true"}}; using var buffer = new ResizableBuffer(); @@ -117,7 +117,7 @@ private static void AssertReadRoundtrip(ResizableBuffer buffer, ExpectedColumn[] using var fileMetaData = fileReader.FileMetaData; var numRows = expectedColumns.First().Values.Length; - + Assert.AreEqual("parquet-cpp-arrow version 4.0.0", fileMetaData.CreatedBy); Assert.AreEqual(new Dictionary {{"case", "Test"}, {"Awesome", "true"}}, fileMetaData.KeyValueMetadata); Assert.AreEqual(expectedColumns.Length, fileMetaData.NumColumns); @@ -153,14 +153,14 @@ private static void AssertReadRoundtrip(ResizableBuffer buffer, ExpectedColumn[] Assert.AreEqual(expected.TypeScale, descr.TypeScale); Assert.AreEqual( - expected.Encodings.Where(e => useDictionaryEncoding || e != Encoding.PlainDictionary).ToArray(), + expected.Encodings.Where(e => useDictionaryEncoding || e != Encoding.PlainDictionary).ToArray(), chunkMetaData.Encodings.Distinct().ToArray()); Assert.AreEqual(expected.Compression, chunkMetaData.Compression); Assert.AreEqual(expected.Values, columnReader.Apply(new PhysicalValueGetter(chunkMetaData.NumValues)).values); } } - + private static GroupNode CreateSchema(ExpectedColumn[] expectedColumns) { var fields = expectedColumns @@ -215,7 +215,7 @@ private static ExpectedColumn[] CreateExpectedColumns(int numRows) Name = "int96_field", PhysicalType = PhysicalType.Int96, SortOrder = SortOrder.Unknown, - Values = Enumerable.Range(0, numRows).Select(i => new Int96(i, i*2, i*3)).ToArray() + Values = Enumerable.Range(0, numRows).Select(i => new Int96(i, i * 2, i * 3)).ToArray() }, new ExpectedColumn { diff --git a/csharp.test/TestRowOrientedParquetFile.cs b/csharp.test/TestRowOrientedParquetFile.cs index 0e9775f4..f697c8ba 100644 --- a/csharp.test/TestRowOrientedParquetFile.cs +++ b/csharp.test/TestRowOrientedParquetFile.cs @@ -1,5 +1,4 @@ - -//#define DUMP_EXPRESSION_TREES // uncomment in to get a dump on Console of the expression trees being created. +//#define DUMP_EXPRESSION_TREES // uncomment in to get a dump on Console of the expression trees being created. using System; using System.Collections.Generic; @@ -128,11 +127,11 @@ public static void TestWriterDoubleDispose() public static void TestCompressionArgument([Values(Compression.Uncompressed, Compression.Brotli)] Compression compression) { using var buffer = new ResizableBuffer(); - + using (var outputStream = new BufferOutputStream(buffer)) { using var writer = ParquetFile.CreateRowWriter<(int, float)>(outputStream, compression: compression); - + writer.WriteRows(new[] {(42, 3.14f)}); writer.Close(); } @@ -164,9 +163,9 @@ private static void TestRoundtrip(TTuple[] rows) var columnNames = Enumerable.Range(1, typeof(TTuple).GetFields().Length + typeof(TTuple).GetProperties().Length) - .Select(x => $"Col{x}") - .ToArray(); - + .Select(x => $"Col{x}") + .ToArray(); + RoundTripAndCompare(rows, rows, columnNames); } @@ -228,7 +227,7 @@ private struct MappedRow1 { // ReSharper disable once UnusedMember.Local // ReSharper disable once UnusedMember.Global - public MappedRow1(Row1 r) + public MappedRow1(Row1 r) { A = r.A; B = r.B; @@ -238,7 +237,7 @@ public MappedRow1(Row1 r) // ReSharper disable once UnusedMember.Local // ReSharper disable once UnusedMember.Global - public MappedRow1(MappedRow2 r) + public MappedRow1(MappedRow2 r) { A = r.Q; B = r.R; diff --git a/csharp.test/TestWriterProperties.cs b/csharp.test/TestWriterProperties.cs index a166b17a..79ae759c 100644 --- a/csharp.test/TestWriterProperties.cs +++ b/csharp.test/TestWriterProperties.cs @@ -18,11 +18,11 @@ public static void TestDefaultProperties() Assert.AreEqual("parquet-cpp-arrow version 4.0.0", p.CreatedBy); Assert.AreEqual(Compression.Uncompressed, p.Compression(new ColumnPath("anypath"))); Assert.AreEqual(int.MinValue, p.CompressionLevel(new ColumnPath("anypath"))); - Assert.AreEqual(1024*1024, p.DataPageSize); + Assert.AreEqual(1024 * 1024, p.DataPageSize); Assert.AreEqual(Encoding.PlainDictionary, p.DictionaryIndexEncoding); Assert.AreEqual(Encoding.PlainDictionary, p.DictionaryPageEncoding); - Assert.AreEqual(1024*1024, p.DictionaryPagesizeLimit); - Assert.AreEqual(64*1024*1024, p.MaxRowGroupLength); + Assert.AreEqual(1024 * 1024, p.DictionaryPagesizeLimit); + Assert.AreEqual(64 * 1024 * 1024, p.MaxRowGroupLength); Assert.AreEqual(ParquetVersion.PARQUET_1_0, p.Version); Assert.AreEqual(1024, p.WriteBatchSize); } diff --git a/csharp/.editorconfig b/csharp/.editorconfig new file mode 100644 index 00000000..31376257 --- /dev/null +++ b/csharp/.editorconfig @@ -0,0 +1,29 @@ +[*.{csproj,json,targets}] +indent_size = 2 +resharper_xml_wrap_tags_and_pi = false + +[*.cs] +csharp_new_line_before_members_in_object_initializers = false +csharp_preserve_single_line_blocks = true +resharper_blank_lines_after_block_statements = 0 +resharper_blank_lines_around_auto_property = 0 +resharper_blank_lines_around_single_line_type = 0 +resharper_csharp_blank_lines_around_field = 0 +resharper_csharp_insert_final_newline = true +resharper_csharp_wrap_lines = false +resharper_empty_block_style = multiline +resharper_keep_existing_embedded_block_arrangement = false +resharper_keep_existing_enum_arrangement = false +resharper_max_attribute_length_for_same_line = 70 +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_expr_accessor_on_single_line = true +resharper_place_expr_method_on_single_line = true +resharper_place_expr_property_on_single_line = true +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = true +resharper_place_simple_initializer_on_single_line = false +resharper_remove_blank_lines_near_braces_in_code = false +resharper_remove_blank_lines_near_braces_in_declarations = false +resharper_wrap_array_initializer_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_object_and_collection_initializer_style = chop_always \ No newline at end of file diff --git a/csharp/ApplicationVersion.cs b/csharp/ApplicationVersion.cs index 67e9b1ce..af8beaec 100644 --- a/csharp/ApplicationVersion.cs +++ b/csharp/ApplicationVersion.cs @@ -51,4 +51,4 @@ internal readonly struct CStruct }; } -} \ No newline at end of file +} diff --git a/csharp/ColumnChunkMetaData.cs b/csharp/ColumnChunkMetaData.cs index 6849b263..f8ac795e 100644 --- a/csharp/ColumnChunkMetaData.cs +++ b/csharp/ColumnChunkMetaData.cs @@ -36,7 +36,7 @@ public unsafe Encoding[] Encodings fixed (Encoding* dst = encodings) { - Buffer.MemoryCopy(src, dst, count*sizeof(Encoding), count*sizeof(Encoding)); + Buffer.MemoryCopy(src, dst, count * sizeof(Encoding), count * sizeof(Encoding)); } return encodings; @@ -50,10 +50,10 @@ public unsafe Encoding[] Encodings public long TotalUncompressedSize => ExceptionInfo.Return(_handle, ColumnChunkMetaData_Total_Uncompressed_Size); public Statistics? Statistics => Statistics.Create(ExceptionInfo.Return(_handle, ColumnChunkMetaData_Statistics)); public PhysicalType Type => ExceptionInfo.Return(_handle, ColumnChunkMetaData_Type); - + [DllImport(ParquetDll.Name)] private static extern void ColumnChunkMetaData_Free(IntPtr columnChunkMetaData); - + [DllImport(ParquetDll.Name)] private static extern IntPtr ColumnChunkMetaData_Compression(IntPtr columnChunkMetaData, out Compression compression); @@ -89,4 +89,4 @@ public unsafe Encoding[] Encodings private readonly ParquetHandle _handle; } -} \ No newline at end of file +} diff --git a/csharp/ColumnCryptoMetaData.cs b/csharp/ColumnCryptoMetaData.cs index 76c3b776..22b43ae2 100644 --- a/csharp/ColumnCryptoMetaData.cs +++ b/csharp/ColumnCryptoMetaData.cs @@ -23,18 +23,18 @@ public void Dispose() public bool EncryptedWithFooterKey => ExceptionInfo.Return(_handle, ColumnCryptoMetaData_Encrypted_With_Footer_Key); public string KeyMetadata => ExceptionInfo.ReturnString(_handle, ColumnCryptoMetaData_Key_Metadata); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern void ColumnCryptoMetaData_Free(IntPtr columnCryptoMetaData); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr ColumnCryptoMetaData_Path_In_Schema(IntPtr columnCryptoMetaData, out IntPtr columnPath); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr ColumnCryptoMetaData_Encrypted_With_Footer_Key(IntPtr columnCryptoMetaData, [MarshalAs(UnmanagedType.I1)] out bool encryptedWithFooterKey); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr ColumnCryptoMetaData_Key_Metadata(IntPtr columnCryptoMetaData, out IntPtr keyMetadata); - private readonly ParquetHandle _handle; + private readonly ParquetHandle _handle; } } diff --git a/csharp/ColumnDescriptor.cs b/csharp/ColumnDescriptor.cs index fcf9c04b..51754db0 100644 --- a/csharp/ColumnDescriptor.cs +++ b/csharp/ColumnDescriptor.cs @@ -120,4 +120,4 @@ public TReturn Apply(LogicalTypeFactory typeFactory, Type? columnLogica private readonly IntPtr _handle; } -} \ No newline at end of file +} diff --git a/csharp/ColumnOrder.cs b/csharp/ColumnOrder.cs index 80850321..35105d90 100644 --- a/csharp/ColumnOrder.cs +++ b/csharp/ColumnOrder.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum ColumnOrder @@ -6,4 +5,4 @@ public enum ColumnOrder Undefined = 0, TypeDefinedOrder = 1 } -} \ No newline at end of file +} diff --git a/csharp/ColumnReader.cs b/csharp/ColumnReader.cs index 0503fd9a..5240e454 100644 --- a/csharp/ColumnReader.cs +++ b/csharp/ColumnReader.cs @@ -101,43 +101,43 @@ public LogicalColumnReader LogicalReaderOverride(int bufferL [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Bool( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, bool* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, bool* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Int32( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, int* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, int* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Int64( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, long* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, long* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Int96( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, Int96* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, Int96* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Float( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, float* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, float* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_Double( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, double* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, double* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_ByteArray( - IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, ByteArray* values, + IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, ByteArray* values, out long valuesRead, out long levelsRead); [DllImport(ParquetDll.Name)] protected static extern unsafe IntPtr TypedColumnReader_ReadBatch_FixedLenByteArray( IntPtr columnReader, long batchSize, short* defLevels, short* repLevels, FixedLenByteArray* values, out long valuesRead, out long levelsRead); - + [DllImport(ParquetDll.Name)] protected static extern IntPtr TypedColumnReader_Skip_Bool(IntPtr columnReader, long numRowsToSkip, out long levelsSkipped); @@ -202,7 +202,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span { if (type == typeof(bool)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Bool(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Bool(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (bool*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -210,7 +210,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(int)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int32(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int32(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (int*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -218,7 +218,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(long)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int64(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int64(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (long*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -226,7 +226,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(Int96)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int96(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Int96(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (Int96*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -234,7 +234,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(float)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Float(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Float(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (float*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -242,7 +242,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(double)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_Double(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_Double(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (double*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -258,7 +258,7 @@ public unsafe long ReadBatch(long batchSize, Span defLevels, Span if (type == typeof(FixedLenByteArray)) { - ExceptionInfo.Check(TypedColumnReader_ReadBatch_FixedLenByteArray(Handle.IntPtr, + ExceptionInfo.Check(TypedColumnReader_ReadBatch_FixedLenByteArray(Handle.IntPtr, batchSize, pDefLevels, pRepLevels, (FixedLenByteArray*) pValues, out valuesRead, out var levelsRead)); GC.KeepAlive(Handle); return levelsRead; @@ -315,4 +315,4 @@ public override long Skip(long numRowsToSkip) throw new NotSupportedException($"type {type} is not supported"); } } -} \ No newline at end of file +} diff --git a/csharp/ColumnWriter.cs b/csharp/ColumnWriter.cs index 1084c792..35993a54 100644 --- a/csharp/ColumnWriter.cs +++ b/csharp/ColumnWriter.cs @@ -56,7 +56,7 @@ public long Close() public int ColumnIndex { get; } public LogicalTypeFactory LogicalTypeFactory => RowGroupWriter.ParquetFileWriter.LogicalTypeFactory; public LogicalWriteConverterFactory LogicalWriteConverterFactory => RowGroupWriter.ParquetFileWriter.LogicalWriteConverterFactory; - + public ColumnDescriptor ColumnDescriptor => new(ExceptionInfo.Return(Handle, ColumnWriter_Descr)); public long RowWritten => ExceptionInfo.Return(Handle, ColumnWriter_Rows_Written); public PhysicalType Type => ExceptionInfo.Return(Handle, ColumnWriter_Type); @@ -197,56 +197,56 @@ public unsafe void WriteBatch(int numValues, ReadOnlySpan defLevels, Read { if (type == typeof(bool)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Bool(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Bool(Handle, numValues, pDefLevels, pRepLevels, (bool*) pValues)); return; } if (type == typeof(int)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int32(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int32(Handle, numValues, pDefLevels, pRepLevels, (int*) pValues)); return; } if (type == typeof(long)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int64(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int64(Handle, numValues, pDefLevels, pRepLevels, (long*) pValues)); return; } if (type == typeof(Int96)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int96(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Int96(Handle, numValues, pDefLevels, pRepLevels, (Int96*) pValues)); return; } if (type == typeof(float)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Float(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Float(Handle, numValues, pDefLevels, pRepLevels, (float*) pValues)); return; } if (type == typeof(double)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Double(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_Double(Handle, numValues, pDefLevels, pRepLevels, (double*) pValues)); return; } if (type == typeof(ByteArray)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_ByteArray(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_ByteArray(Handle, numValues, pDefLevels, pRepLevels, (ByteArray*) pValues)); return; } if (type == typeof(FixedLenByteArray)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatch_FixedLenByteArray(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatch_FixedLenByteArray(Handle, numValues, pDefLevels, pRepLevels, (FixedLenByteArray*) pValues)); return; } @@ -256,7 +256,7 @@ public unsafe void WriteBatch(int numValues, ReadOnlySpan defLevels, Read } public unsafe void WriteBatchSpaced( - int numValues, ReadOnlySpan defLevels, ReadOnlySpan repLevels, + int numValues, ReadOnlySpan defLevels, ReadOnlySpan repLevels, ReadOnlySpan validBits, long validBitsOffset, ReadOnlySpan values) { if (values == null) throw new ArgumentNullException(nameof(values)); @@ -285,49 +285,49 @@ public unsafe void WriteBatchSpaced( if (type == typeof(int)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int32(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int32(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (int*) pValues)); return; } if (type == typeof(long)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int64(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int64(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (long*) pValues)); return; } if (type == typeof(Int96)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int96(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Int96(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (Int96*) pValues)); return; } if (type == typeof(float)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Float(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Float(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (float*) pValues)); return; } if (type == typeof(double)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Double(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_Double(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (double*) pValues)); return; } if (type == typeof(ByteArray)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_ByteArray(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_ByteArray(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (ByteArray*) pValues)); return; } if (type == typeof(FixedLenByteArray)) { - ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_FixedLenByteArray(Handle, + ExceptionInfo.Check(TypedColumnWriter_WriteBatchSpaced_FixedLenByteArray(Handle, numValues, pDefLevels, pRepLevels, pValidBits, validBitsOffset, (FixedLenByteArray*) pValues)); return; } diff --git a/csharp/Compression.cs b/csharp/Compression.cs index 8f490a05..71248502 100644 --- a/csharp/Compression.cs +++ b/csharp/Compression.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum Compression diff --git a/csharp/DateTimeNanos.cs b/csharp/DateTimeNanos.cs index e264fc5c..0e324832 100644 --- a/csharp/DateTimeNanos.cs +++ b/csharp/DateTimeNanos.cs @@ -16,7 +16,7 @@ public DateTimeNanos(long ticks) public DateTimeNanos(DateTime dateTime) { - Ticks = (dateTime.Ticks - DateTimeOffset) * (1_000_000L / TimeSpan.TicksPerMillisecond); + Ticks = (dateTime.Ticks - DateTimeOffset) * (1_000_000L / TimeSpan.TicksPerMillisecond); } /// diff --git a/csharp/Decimal128.cs b/csharp/Decimal128.cs index 567967d4..c0c902b3 100644 --- a/csharp/Decimal128.cs +++ b/csharp/Decimal128.cs @@ -26,7 +26,7 @@ public Decimal128(decimal value, decimal multiplier) } catch (OverflowException exception) { - throw new OverflowException($"value {value:E} is too large for decimal scale {Math.Log10((double)multiplier)}", exception); + throw new OverflowException($"value {value:E} is too large for decimal scale {Math.Log10((double) multiplier)}", exception); } var src = (uint*) &unscaled; diff --git a/csharp/Encoding.cs b/csharp/Encoding.cs index d5422c92..84641652 100644 --- a/csharp/Encoding.cs +++ b/csharp/Encoding.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum Encoding @@ -14,4 +13,4 @@ public enum Encoding ByteStreamSplit = 9, Undefined = 10 } -} \ No newline at end of file +} diff --git a/csharp/ExceptionInfo.cs b/csharp/ExceptionInfo.cs index a342a77d..b303454b 100644 --- a/csharp/ExceptionInfo.cs +++ b/csharp/ExceptionInfo.cs @@ -1,4 +1,3 @@ - using System; using System.Runtime.InteropServices; @@ -117,4 +116,4 @@ private static string ConvertPtrToString(ParquetHandle handle, Action? d [DllImport(ParquetDll.Name)] private static extern IntPtr ExceptionInfo_Message(IntPtr exceptionInfo); } -} \ No newline at end of file +} diff --git a/csharp/FileDecryptionPropertiesBuilder.cs b/csharp/FileDecryptionPropertiesBuilder.cs index d6f016d8..3fc86230 100644 --- a/csharp/FileDecryptionPropertiesBuilder.cs +++ b/csharp/FileDecryptionPropertiesBuilder.cs @@ -19,7 +19,7 @@ public void Dispose() { _handle.Dispose(); } - + public FileDecryptionPropertiesBuilder FooterKey(byte[] footerKey) { var footerAesKey = new AesKey(footerKey); @@ -124,9 +124,9 @@ public FileDecryptionPropertiesBuilder PlaintextFilesAllowed() [DllImport(ParquetDll.Name)] private static extern IntPtr FileDecryptionPropertiesBuilder_Key_Retriever( - IntPtr builder, + IntPtr builder, IntPtr gcHandle, - DecryptionKeyRetriever.FreeGcHandleFunc freeGcHandle, + DecryptionKeyRetriever.FreeGcHandleFunc freeGcHandle, DecryptionKeyRetriever.GetKeyFunc getKey); [DllImport(ParquetDll.Name)] diff --git a/csharp/FileMetaData.cs b/csharp/FileMetaData.cs index da695d6c..457ae6d3 100644 --- a/csharp/FileMetaData.cs +++ b/csharp/FileMetaData.cs @@ -87,4 +87,4 @@ public bool Equals(FileMetaData? other) private readonly ParquetHandle _handle; private SchemaDescriptor? _schema; } -} \ No newline at end of file +} diff --git a/csharp/IColumnDescriptorVisitor.cs b/csharp/IColumnDescriptorVisitor.cs index cefdf395..74ad3282 100644 --- a/csharp/IColumnDescriptorVisitor.cs +++ b/csharp/IColumnDescriptorVisitor.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { /// /// Visitor on ColumnDescriptor to discover the system types in a type safe manner. diff --git a/csharp/IColumnReaderVisitor.cs b/csharp/IColumnReaderVisitor.cs index e4f6740c..cbbb3ed6 100644 --- a/csharp/IColumnReaderVisitor.cs +++ b/csharp/IColumnReaderVisitor.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { /// diff --git a/csharp/IColumnWriterVisitor.cs b/csharp/IColumnWriterVisitor.cs index 36648409..f2f425b7 100644 --- a/csharp/IColumnWriterVisitor.cs +++ b/csharp/IColumnWriterVisitor.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { /// /// Visitor on ColumnWriter to discover the derived writer type in a type safe manner. diff --git a/csharp/ILogicalColumnReaderVisitor.cs b/csharp/ILogicalColumnReaderVisitor.cs index 0d7c1e3e..222312e2 100644 --- a/csharp/ILogicalColumnReaderVisitor.cs +++ b/csharp/ILogicalColumnReaderVisitor.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { /// /// Visitor on LogicalColumnReader to discover the derived reader type in a type safe manner. diff --git a/csharp/ILogicalColumnWriterVisitor.cs b/csharp/ILogicalColumnWriterVisitor.cs index a15a6a26..f5288ca4 100644 --- a/csharp/ILogicalColumnWriterVisitor.cs +++ b/csharp/ILogicalColumnWriterVisitor.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { /// /// Visitor on LogicalColumnWriter to discover the derived writer type in a type safe manner. diff --git a/csharp/IO/BufferOutputStream.cs b/csharp/IO/BufferOutputStream.cs index 29fcf560..2f5854cd 100644 --- a/csharp/IO/BufferOutputStream.cs +++ b/csharp/IO/BufferOutputStream.cs @@ -8,7 +8,7 @@ namespace ParquetSharp.IO /// public sealed class BufferOutputStream : OutputStream { - public BufferOutputStream() + public BufferOutputStream() : base(ExceptionInfo.Return(BufferOutputStream_Create)) { } diff --git a/csharp/IO/ManagedRandomAccessFile.cs b/csharp/IO/ManagedRandomAccessFile.cs index bb039c08..e0dd701f 100644 --- a/csharp/IO/ManagedRandomAccessFile.cs +++ b/csharp/IO/ManagedRandomAccessFile.cs @@ -69,7 +69,7 @@ private byte Close(out string? exception) { try { - if(!_leaveOpen) + if (!_leaveOpen) { _stream.Close(); } diff --git a/csharp/IO/RandomAccessFile.cs b/csharp/IO/RandomAccessFile.cs index 8964dee1..70591be3 100644 --- a/csharp/IO/RandomAccessFile.cs +++ b/csharp/IO/RandomAccessFile.cs @@ -13,7 +13,7 @@ protected RandomAccessFile() Handle = null; } - protected RandomAccessFile(IntPtr handle) + protected RandomAccessFile(IntPtr handle) { Handle = new ParquetHandle(handle, RandomAccessFile_Free); } diff --git a/csharp/IO/ResizableBuffer.cs b/csharp/IO/ResizableBuffer.cs index 42e17c9b..6814ff45 100644 --- a/csharp/IO/ResizableBuffer.cs +++ b/csharp/IO/ResizableBuffer.cs @@ -1,5 +1,4 @@ - -using System; +using System; using System.Runtime.InteropServices; namespace ParquetSharp.IO diff --git a/csharp/InternalsVisibleTo.cs b/csharp/InternalsVisibleTo.cs index 9d2b9ea2..a1b44804 100644 --- a/csharp/InternalsVisibleTo.cs +++ b/csharp/InternalsVisibleTo.cs @@ -1,3 +1,3 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("ParquetSharp.Test")] \ No newline at end of file +[assembly: InternalsVisibleTo("ParquetSharp.Test")] diff --git a/csharp/KeyValueMetadata.cs b/csharp/KeyValueMetadata.cs index 3e0d6bd1..04a96e16 100644 --- a/csharp/KeyValueMetadata.cs +++ b/csharp/KeyValueMetadata.cs @@ -81,7 +81,7 @@ private static unsafe IntPtr Make(IReadOnlyDictionary keyValueMe [DllImport(ParquetDll.Name)] private static extern IntPtr KeyValueMetadata_Size(IntPtr keyValueMetadata, out long size); - + [DllImport(ParquetDll.Name)] private static extern IntPtr KeyValueMetadata_Get_Entries(IntPtr keyValueMetadata, out IntPtr keys, out IntPtr values); diff --git a/csharp/LogicalColumnReader.cs b/csharp/LogicalColumnReader.cs index ac95fb95..82286ca2 100644 --- a/csharp/LogicalColumnReader.cs +++ b/csharp/LogicalColumnReader.cs @@ -22,10 +22,10 @@ internal static LogicalColumnReader Create(ColumnReader columnReader, int buffer // If an elementTypeOverride is given, then we already know what the column reader logical system type should be. var columnLogicalTypeOverride = GetLeafElementType(elementTypeOverride); - + return columnReader.ColumnDescriptor.Apply( - columnReader.LogicalTypeFactory, - columnLogicalTypeOverride, + columnReader.LogicalTypeFactory, + columnLogicalTypeOverride, new Creator(columnReader, bufferLength)); } @@ -142,8 +142,8 @@ public override int ReadBatch(Span destination) // Otherwise deal with flat values. return ReadBatchSimple( - destination, - _directReader as LogicalRead.DirectReader, + destination, + _directReader as LogicalRead.DirectReader, (_converter as LogicalRead.Converter)!); } @@ -157,16 +157,16 @@ private int ReadBatchArray(Span destination, LogicalRead schemaNodes, Type elementType, LogicalRead.Converter converter, + ReadOnlySpan schemaNodes, Type elementType, LogicalRead.Converter converter, BufferedReader valueReader, int numArrayEntriesToRead, int repetitionLevel, int nullDefinitionLevel) { if (elementType.IsArray && elementType != typeof(byte[])) { - if (schemaNodes.Length >= 2 && - schemaNodes[0] is GroupNode {LogicalType: ListLogicalType, Repetition: Repetition.Optional} && + if (schemaNodes.Length >= 2 && + schemaNodes[0] is GroupNode {LogicalType: ListLogicalType, Repetition: Repetition.Optional} && schemaNodes[1] is GroupNode {LogicalType: NoneLogicalType, Repetition: Repetition.Repeated}) { - return ReadArrayIntermediateLevel(schemaNodes, valueReader, elementType, converter, numArrayEntriesToRead, (short)repetitionLevel, (short)nullDefinitionLevel); + return ReadArrayIntermediateLevel(schemaNodes, valueReader, elementType, converter, numArrayEntriesToRead, (short) repetitionLevel, (short) nullDefinitionLevel); } throw new Exception("elementType is an array but schema does not match the expected layout"); @@ -176,13 +176,13 @@ private static Array ReadArray( { bool optional = schemaNodes[0].Repetition == Repetition.Optional; - return ReadArrayLeafLevel(valueReader, converter, optional, (short)repetitionLevel, (short)nullDefinitionLevel); + return ReadArrayLeafLevel(valueReader, converter, optional, (short) repetitionLevel, (short) nullDefinitionLevel); } throw new Exception("ParquetSharp does not understand the schema used"); } - private static Array ReadArrayIntermediateLevel(ReadOnlySpan schemaNodes, BufferedReader valueReader, Type elementType, + private static Array ReadArrayIntermediateLevel(ReadOnlySpan schemaNodes, BufferedReader valueReader, Type elementType, LogicalRead.Converter converter, int numArrayEntriesToRead, short repetitionLevel, short nullDefinitionLevel) { var acc = new List(); @@ -279,7 +279,7 @@ private static Array CreateEmptyArray(Type elementType) /// Fast implementation when a column contains only flat primitive values. /// private int ReadBatchSimple( - Span destination, + Span destination, LogicalRead.DirectReader? directReader, LogicalRead.Converter converter) { @@ -287,7 +287,7 @@ private int ReadBatchSimple( if (directReader != null && DefLevels != null) throw new ArgumentException("direct reader cannot be provided if type is optional"); if (converter == null) throw new ArgumentNullException(nameof(converter)); - var columnReader = (ColumnReader)Source; + var columnReader = (ColumnReader) Source; var rowsRead = 0; // Fast path for logical types that directly map to the physical type in memory. diff --git a/csharp/LogicalColumnWriter.cs b/csharp/LogicalColumnWriter.cs index 08839f3e..65d3145d 100644 --- a/csharp/LogicalColumnWriter.cs +++ b/csharp/LogicalColumnWriter.cs @@ -24,8 +24,8 @@ internal static LogicalColumnWriter Create(ColumnWriter columnWriter, int buffer var columnLogicalTypeOverride = GetLeafElementType(elementTypeOverride ?? columns?[columnWriter.ColumnIndex].LogicalSystemType); return columnWriter.ColumnDescriptor.Apply( - columnWriter.LogicalTypeFactory, - columnLogicalTypeOverride, + columnWriter.LogicalTypeFactory, + columnLogicalTypeOverride, new Creator(columnWriter, bufferLength)); } @@ -96,7 +96,7 @@ internal LogicalColumnWriter(ColumnWriter columnWriter, int bufferLength) : base(columnWriter, bufferLength) { _byteBuffer = typeof(TPhysical) == typeof(ByteArray) || typeof(TPhysical) == typeof(FixedLenByteArray) - ? new ByteBuffer(bufferLength) + ? new ByteBuffer(bufferLength) : null; // Convert logical values into physical values at the lowest array level @@ -127,8 +127,8 @@ private void WriteArray(Array array, ReadOnlySpan schemaNodes, Type elemen { if (elementType.IsArray && elementType != typeof(byte[])) { - if (schemaNodes.Length >= 2 && - schemaNodes[0] is GroupNode {LogicalType: ListLogicalType, Repetition: Repetition.Optional} && + if (schemaNodes.Length >= 2 && + schemaNodes[0] is GroupNode {LogicalType: ListLogicalType, Repetition: Repetition.Optional} && schemaNodes[1] is GroupNode {LogicalType: NoneLogicalType, Repetition: Repetition.Repeated}) { var containedType = elementType.GetElementType(); @@ -152,8 +152,8 @@ private void WriteArray(Array array, ReadOnlySpan schemaNodes, Type elemen { bool isOptional = schemaNodes[0].Repetition == Repetition.Optional; - short leafDefinitionLevel = isOptional ? (short)(nullDefinitionLevel + 1) : nullDefinitionLevel; - short leafNullDefinitionLevel = isOptional ? nullDefinitionLevel : (short)-1; + short leafDefinitionLevel = isOptional ? (short) (nullDefinitionLevel + 1) : nullDefinitionLevel; + short leafNullDefinitionLevel = isOptional ? nullDefinitionLevel : (short) -1; WriteArrayFinalLevel(array, repetitionLevel, firstLeafRepLevel, leafDefinitionLevel, leafNullDefinitionLevel); @@ -165,7 +165,7 @@ private void WriteArray(Array array, ReadOnlySpan schemaNodes, Type elemen private void WriteArrayIntermediateLevel(Array values, ReadOnlySpan schemaNodes, Type elementType, short nullDefinitionLevel, short repetitionLevel, short firstLeafRepLevel) { - var columnWriter = (ColumnWriter)Source; + var columnWriter = (ColumnWriter) Source; for (var i = 0; i < values.Length; i++) { @@ -182,18 +182,18 @@ private void WriteArrayIntermediateLevel(Array values, ReadOnlySpan schema if (a.Length > 0) { // We have a positive length array, call the top level array writer on its values - WriteArray(a, schemaNodes, elementType, (short)(repetitionLevel + 1), (short)(nullDefinitionLevel + 2), currentLeafRepLevel); + WriteArray(a, schemaNodes, elementType, (short) (repetitionLevel + 1), (short) (nullDefinitionLevel + 2), currentLeafRepLevel); } else { // Write that we have a zero length array - columnWriter.WriteBatchSpaced(1, new[] { (short)(nullDefinitionLevel + 1) }, new[] { currentLeafRepLevel }, new byte[] { 0 }, 0, new TPhysical[] { }); + columnWriter.WriteBatchSpaced(1, new[] {(short) (nullDefinitionLevel + 1)}, new[] {currentLeafRepLevel}, new byte[] {0}, 0, new TPhysical[] { }); } } else { // Write that this item is null - columnWriter.WriteBatchSpaced(1, new[] { nullDefinitionLevel }, new[] { currentLeafRepLevel }, new byte[] { 0 }, 0, new TPhysical[] { }); + columnWriter.WriteBatchSpaced(1, new[] {nullDefinitionLevel}, new[] {currentLeafRepLevel}, new byte[] {0}, 0, new TPhysical[] { }); } } } @@ -202,12 +202,12 @@ private void WriteArrayIntermediateLevel(Array values, ReadOnlySpan schema /// Write implementation for writing the deepest level array. /// private void WriteArrayFinalLevel( - Array values, - short repetitionLevel, short leafFirstRepLevel, - short leafDefinitionLevel, + Array values, + short repetitionLevel, short leafFirstRepLevel, + short leafDefinitionLevel, short nullDefinitionLevel) { - ReadOnlySpan valuesSpan = (TLogical[])values; + ReadOnlySpan valuesSpan = (TLogical[]) values; if (DefLevels == null) throw new InvalidOperationException("DefLevels should not be null."); if (RepLevels == null) throw new InvalidOperationException("RepLevels should not be null."); diff --git a/csharp/LogicalReadConverterFactory.cs b/csharp/LogicalReadConverterFactory.cs index 78d91734..5f404e87 100644 --- a/csharp/LogicalReadConverterFactory.cs +++ b/csharp/LogicalReadConverterFactory.cs @@ -1,5 +1,4 @@ - -using System; +using System; namespace ParquetSharp { @@ -16,7 +15,7 @@ public class LogicalReadConverterFactory /// /// A delegate of type LogicalRead<TLogical, TPhysical>.DirectReader /// - public virtual Delegate? GetDirectReader() + public virtual Delegate? GetDirectReader() where TPhysical : unmanaged { return LogicalRead.GetDirectReader(); diff --git a/csharp/LogicalType.cs b/csharp/LogicalType.cs index 090839da..807b9e71 100644 --- a/csharp/LogicalType.cs +++ b/csharp/LogicalType.cs @@ -1,4 +1,3 @@ - using System; using System.Runtime.InteropServices; @@ -272,4 +271,4 @@ public sealed class NoneLogicalType : LogicalType { internal NoneLogicalType(IntPtr handle) : base(handle) { } } -} \ No newline at end of file +} diff --git a/csharp/LogicalWriteConverterFactory.cs b/csharp/LogicalWriteConverterFactory.cs index 2cb7fccc..b961f4be 100644 --- a/csharp/LogicalWriteConverterFactory.cs +++ b/csharp/LogicalWriteConverterFactory.cs @@ -1,5 +1,4 @@ - -using System; +using System; namespace ParquetSharp { diff --git a/csharp/MemoryPool.cs b/csharp/MemoryPool.cs index 14830cb5..e905734f 100644 --- a/csharp/MemoryPool.cs +++ b/csharp/MemoryPool.cs @@ -22,7 +22,7 @@ private MemoryPool(IntPtr handle) _handle = handle; } - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr MemoryPool_Default_Memory_Pool(out IntPtr memoryPool); [DllImport(ParquetDll.Name)] diff --git a/csharp/ParquetCipher.cs b/csharp/ParquetCipher.cs index 6fea5239..e2c9e84c 100644 --- a/csharp/ParquetCipher.cs +++ b/csharp/ParquetCipher.cs @@ -1,9 +1,8 @@ - -namespace ParquetSharp +namespace ParquetSharp { public enum ParquetCipher { - AesGcmV1 = 0, + AesGcmV1 = 0, AesGcmCtrV1 = 1 } } diff --git a/csharp/ParquetDll.cs b/csharp/ParquetDll.cs index c5374588..cfe44875 100644 --- a/csharp/ParquetDll.cs +++ b/csharp/ParquetDll.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { internal static class ParquetDll diff --git a/csharp/ParquetException.cs b/csharp/ParquetException.cs index 716b8931..3444edfa 100644 --- a/csharp/ParquetException.cs +++ b/csharp/ParquetException.cs @@ -1,4 +1,3 @@ - using System; namespace ParquetSharp @@ -13,4 +12,4 @@ public ParquetException(string type, string message) { } } -} \ No newline at end of file +} diff --git a/csharp/ParquetFileReader.cs b/csharp/ParquetFileReader.cs index 6dbf6cb6..d9e05685 100644 --- a/csharp/ParquetFileReader.cs +++ b/csharp/ParquetFileReader.cs @@ -80,4 +80,4 @@ public RowGroupReader RowGroup(int i) private readonly ParquetHandle _handle; private FileMetaData? _fileMetaData; } -} \ No newline at end of file +} diff --git a/csharp/ParquetFileWriter.cs b/csharp/ParquetFileWriter.cs index 54936c69..25b5a949 100644 --- a/csharp/ParquetFileWriter.cs +++ b/csharp/ParquetFileWriter.cs @@ -9,9 +9,9 @@ namespace ParquetSharp public sealed class ParquetFileWriter : IDisposable { public ParquetFileWriter( - string path, - Column[] columns, - Compression compression = Compression.Snappy, + string path, + Column[] columns, + Compression compression = Compression.Snappy, IReadOnlyDictionary? keyValueMetadata = null) { using var schema = Column.CreateSchemaNode(columns); @@ -21,9 +21,9 @@ public ParquetFileWriter( } public ParquetFileWriter( - OutputStream outputStream, - Column[] columns, - Compression compression = Compression.Snappy, + OutputStream outputStream, + Column[] columns, + Compression compression = Compression.Snappy, IReadOnlyDictionary? keyValueMetadata = null) { using var schema = Column.CreateSchemaNode(columns); @@ -59,7 +59,7 @@ public ParquetFileWriter( } public ParquetFileWriter( - string path, + string path, Column[] columns, WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata = null) @@ -70,7 +70,7 @@ public ParquetFileWriter( } public ParquetFileWriter( - OutputStream outputStream, + OutputStream outputStream, Column[] columns, WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata = null) @@ -105,9 +105,9 @@ public ParquetFileWriter( } public ParquetFileWriter( - string path, - GroupNode schema, - WriterProperties writerProperties, + string path, + GroupNode schema, + WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata = null) { _handle = CreateParquetFileWriter(path, schema, writerProperties, keyValueMetadata); @@ -115,8 +115,8 @@ public ParquetFileWriter( } public ParquetFileWriter( - OutputStream outputStream, - GroupNode schema, + OutputStream outputStream, + GroupNode schema, WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata = null) { @@ -197,8 +197,8 @@ public FileMetaData? FileMetaData } private static ParquetHandle CreateParquetFileWriter( - string path, - GroupNode schema, + string path, + GroupNode schema, WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata) { @@ -220,8 +220,8 @@ private static ParquetHandle CreateParquetFileWriter( } private static ParquetHandle CreateParquetFileWriter( - OutputStream outputStream, - GroupNode schema, + OutputStream outputStream, + GroupNode schema, WriterProperties writerProperties, IReadOnlyDictionary? keyValueMetadata) { diff --git a/csharp/ParquetHandle.cs b/csharp/ParquetHandle.cs index b19e1941..acc7ef31 100644 --- a/csharp/ParquetHandle.cs +++ b/csharp/ParquetHandle.cs @@ -51,4 +51,4 @@ public IntPtr IntPtr private IntPtr _handle; private readonly Action _free; } -} \ No newline at end of file +} diff --git a/csharp/ParquetSharp.csproj b/csharp/ParquetSharp.csproj index e97d453d..3b7c262d 100644 --- a/csharp/ParquetSharp.csproj +++ b/csharp/ParquetSharp.csproj @@ -70,4 +70,4 @@ - + \ No newline at end of file diff --git a/csharp/ParquetSharp.targets b/csharp/ParquetSharp.targets index 68cc2101..385f7520 100644 --- a/csharp/ParquetSharp.targets +++ b/csharp/ParquetSharp.targets @@ -1,4 +1,5 @@  + @@ -8,4 +9,4 @@ False - + \ No newline at end of file diff --git a/csharp/ParquetVersion.cs b/csharp/ParquetVersion.cs index 713a42b5..e3b11da1 100644 --- a/csharp/ParquetVersion.cs +++ b/csharp/ParquetVersion.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum ParquetVersion @@ -8,4 +7,4 @@ public enum ParquetVersion PARQUET_2_0 = 1 // ReSharper restore InconsistentNaming } -} \ No newline at end of file +} diff --git a/csharp/PhysicalType.cs b/csharp/PhysicalType.cs index 70260d38..a9f1115c 100644 --- a/csharp/PhysicalType.cs +++ b/csharp/PhysicalType.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum PhysicalType @@ -13,4 +12,4 @@ public enum PhysicalType FixedLenByteArray = 7, Undefined = 8 } -} \ No newline at end of file +} diff --git a/csharp/ReaderProperties.cs b/csharp/ReaderProperties.cs index d2dc16c3..93668917 100644 --- a/csharp/ReaderProperties.cs +++ b/csharp/ReaderProperties.cs @@ -65,7 +65,7 @@ public void DisableBufferedStream() [DllImport(ParquetDll.Name)] private static extern void ReaderProperties_Free(IntPtr readerProperties); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr ReaderProperties_Is_Buffered_Stream_Enabled(IntPtr readerProperties, [MarshalAs(UnmanagedType.I1)] out bool isBufferedStreamEnabled); [DllImport(ParquetDll.Name)] @@ -80,7 +80,7 @@ public void DisableBufferedStream() [DllImport(ParquetDll.Name)] private static extern IntPtr ReaderProperties_Get_Buffer_Size(IntPtr readerProperties, out long bufferSize); - [DllImport(ParquetDll.Name)] + [DllImport(ParquetDll.Name)] private static extern IntPtr ReaderProperties_Set_File_Decryption_Properties(IntPtr readerProperties, IntPtr fileDecryptionProperties); [DllImport(ParquetDll.Name)] diff --git a/csharp/Repetition.cs b/csharp/Repetition.cs index 41a7d044..619b3c1d 100644 --- a/csharp/Repetition.cs +++ b/csharp/Repetition.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { public enum Repetition { diff --git a/csharp/RowGroupMetaData.cs b/csharp/RowGroupMetaData.cs index 4a0f1152..48c1936e 100644 --- a/csharp/RowGroupMetaData.cs +++ b/csharp/RowGroupMetaData.cs @@ -38,4 +38,4 @@ public ColumnChunkMetaData GetColumnChunkMetaData(int i) private readonly IntPtr _handle; private SchemaDescriptor? _schema; } -} \ No newline at end of file +} diff --git a/csharp/RowGroupReader.cs b/csharp/RowGroupReader.cs index 23f33b91..9e6590cc 100644 --- a/csharp/RowGroupReader.cs +++ b/csharp/RowGroupReader.cs @@ -37,4 +37,4 @@ public ColumnReader Column(int i) => ColumnReader.Create( internal readonly ParquetFileReader ParquetFileReader; private RowGroupMetaData? _metaData; } -} \ No newline at end of file +} diff --git a/csharp/RowOriented/ParquetFile.cs b/csharp/RowOriented/ParquetFile.cs index 01e39850..b68431ed 100644 --- a/csharp/RowOriented/ParquetFile.cs +++ b/csharp/RowOriented/ParquetFile.cs @@ -232,7 +232,7 @@ private static Expression For( var initAssign = Expression.Assign(loopVar, initValue); var breakLabel = Expression.Label("LoopBreak"); - return Expression.Block(new[] { loopVar }, + return Expression.Block(new[] {loopVar}, initAssign, Expression.Loop( Expression.IfThenElse( diff --git a/csharp/RowOriented/ParquetRowWriter.cs b/csharp/RowOriented/ParquetRowWriter.cs index e5082bc4..dc381964 100644 --- a/csharp/RowOriented/ParquetRowWriter.cs +++ b/csharp/RowOriented/ParquetRowWriter.cs @@ -82,7 +82,7 @@ public void Close() public void StartNewRowGroup() { if (_rowGroupWriter == null) throw new InvalidOperationException("writer has been closed or disposed"); - + _writeAction(this, _rows, _pos); _pos = 0; diff --git a/csharp/Schema/ColumnPath.cs b/csharp/Schema/ColumnPath.cs index 1d8772f7..b48db881 100644 --- a/csharp/Schema/ColumnPath.cs +++ b/csharp/Schema/ColumnPath.cs @@ -113,4 +113,4 @@ private static IntPtr Make(Node node) [DllImport(ParquetDll.Name)] private static extern void ColumnPath_ToDotVector_Free(IntPtr dotVector, int length); } -} \ No newline at end of file +} diff --git a/csharp/Schema/GroupNode.cs b/csharp/Schema/GroupNode.cs index 6c92aa4e..a2d41462 100644 --- a/csharp/Schema/GroupNode.cs +++ b/csharp/Schema/GroupNode.cs @@ -12,7 +12,7 @@ public GroupNode(string name, Repetition repetition, IReadOnlyList fields, { } - internal GroupNode(IntPtr handle) + internal GroupNode(IntPtr handle) : base(handle) { } @@ -73,4 +73,4 @@ private static extern IntPtr GroupNode_Make( [DllImport(ParquetDll.Name)] private static extern IntPtr GroupNode_Field_Index_By_Node(IntPtr groupNode, IntPtr node, out int index); } -} \ No newline at end of file +} diff --git a/csharp/Schema/Node.cs b/csharp/Schema/Node.cs index 4371705c..f5a40cfc 100644 --- a/csharp/Schema/Node.cs +++ b/csharp/Schema/Node.cs @@ -84,4 +84,4 @@ public bool Equals(Node? other) internal readonly ParquetHandle Handle; } -} \ No newline at end of file +} diff --git a/csharp/Schema/NodeType.cs b/csharp/Schema/NodeType.cs index 47ef6ad7..92a2a002 100644 --- a/csharp/Schema/NodeType.cs +++ b/csharp/Schema/NodeType.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp.Schema { public enum NodeType @@ -6,4 +5,4 @@ public enum NodeType Primitive = 0, Group = 1 }; -} \ No newline at end of file +} diff --git a/csharp/Schema/PrimitiveNode.cs b/csharp/Schema/PrimitiveNode.cs index f045c48c..6a713040 100644 --- a/csharp/Schema/PrimitiveNode.cs +++ b/csharp/Schema/PrimitiveNode.cs @@ -11,16 +11,16 @@ namespace ParquetSharp.Schema public sealed class PrimitiveNode : Node { public PrimitiveNode( - string name, - Repetition repetition, - LogicalType logicalType, + string name, + Repetition repetition, + LogicalType logicalType, PhysicalType physicalType, int primitiveLength = -1) : this(Make(name, repetition, logicalType, physicalType, primitiveLength)) { } - internal PrimitiveNode(IntPtr handle) + internal PrimitiveNode(IntPtr handle) : base(handle) { } diff --git a/csharp/SchemaDescriptor.cs b/csharp/SchemaDescriptor.cs index e6488469..aeab3ea1 100644 --- a/csharp/SchemaDescriptor.cs +++ b/csharp/SchemaDescriptor.cs @@ -61,7 +61,7 @@ public Node ColumnRoot(int i) [DllImport(ParquetDll.Name)] private static extern IntPtr SchemaDescriptor_Schema_Root(IntPtr descriptor, out IntPtr schemaRoot); - + private readonly IntPtr _handle; } -} \ No newline at end of file +} diff --git a/csharp/SortOrder.cs b/csharp/SortOrder.cs index b23ec5cd..54e69413 100644 --- a/csharp/SortOrder.cs +++ b/csharp/SortOrder.cs @@ -1,4 +1,3 @@ - namespace ParquetSharp { public enum SortOrder @@ -7,4 +6,4 @@ public enum SortOrder Unsigned = 1, Unknown = 2 } -} \ No newline at end of file +} diff --git a/csharp/StringUtil.cs b/csharp/StringUtil.cs index 0fddcc52..d41d0ec0 100644 --- a/csharp/StringUtil.cs +++ b/csharp/StringUtil.cs @@ -13,7 +13,7 @@ public static unsafe IntPtr ToCStringUtf8(string str, ByteBuffer byteBuffer) fixed (char* chars = str) { - utf8.GetBytes(chars, str.Length, (byte*)byteArray.Pointer, byteCount); + utf8.GetBytes(chars, str.Length, (byte*) byteArray.Pointer, byteCount); } return byteArray.Pointer; @@ -36,7 +36,7 @@ public static string PtrToStringUtf8(IntPtr ptr) unsafe { - var s = (byte*)ptr; + var s = (byte*) ptr; int length; for (length = 0; s[length] != '\0'; ++length) { diff --git a/csharp/TimeUnit.cs b/csharp/TimeUnit.cs index 889f4e15..c9b868be 100644 --- a/csharp/TimeUnit.cs +++ b/csharp/TimeUnit.cs @@ -1,5 +1,4 @@ - -namespace ParquetSharp +namespace ParquetSharp { public enum TimeUnit { diff --git a/csharp/WriterProperties.cs b/csharp/WriterProperties.cs index 8166a2b4..5e5b796c 100644 --- a/csharp/WriterProperties.cs +++ b/csharp/WriterProperties.cs @@ -62,7 +62,7 @@ public ulong MaxStatisticsSize(ColumnPath path) } internal readonly ParquetHandle Handle; - + [DllImport(ParquetDll.Name)] private static extern IntPtr WriterProperties_Get_Default_Writer_Properties(out IntPtr writerProperties);