emecii commented on code in PR #51277:
URL: https://github.com/apache/arrow/pull/51277#discussion_r4116009277
##########
c_glib/parquet-glib/arrow-file-reader.cpp:
##########
@@ -25,25 +25,222 @@
#include <parquet/file_reader.h>
+namespace {
+ GParquetArrowFileReader *
+ open_reader(std::shared_ptr<arrow::io::RandomAccessFile> source,
Review Comment:
Updated in bce0231ff: the path constructor now shares `open_reader()`, and
both native property accessors return pointers.
##########
c_glib/parquet-glib/arrow-file-reader.hpp:
##########
@@ -25,5 +25,12 @@
GParquetArrowFileReader *
gparquet_arrow_file_reader_new_raw(parquet::arrow::FileReader
*parquet_arrow_file_reader);
+GParquetArrowFileReader *
+gparquet_arrow_file_reader_new_raw(parquet::arrow::FileReader
*parquet_arrow_file_reader,
+ GArrowSeekableInputStream *source);
Review Comment:
Replaced the overloads with the defaulted source argument in bce0231ff.
One-argument source calls still compile; the previous one-argument C++ binary
symbol is replaced. The public C signatures are unchanged.
##########
c_glib/test/parquet/test-arrow-file-reader.rb:
##########
@@ -39,6 +39,109 @@ def setup
end
end
+ sub_test_case(".new with properties") do
+ data("path" => :path, "stream" => :stream)
+ test("read") do |source_type|
+ properties = Parquet::ReaderProperties.new
+ properties.enable_buffered_stream
+ properties.pre_buffer = false
+ properties.buffer_size = 4096
+ source = if source_type == :path
+ @file.path
+ else
+ Arrow::FileInputStream.new(@file.path)
+ end
+ reader = Parquet::ArrowFileReader.new(source, properties)
+ begin
+ assert_equal(@table, reader.read_table)
+ assert_equal(build_table("a" => @a_array.slice(1, 1),
+ "b" => @b_array.slice(1, 1)),
+ reader.read_row_group(1))
+ ensure
+ reader.close
+ reader.unref
+ source.unref if source_type == :stream
+ end
+ end
+
+ test("copies properties") do
+ properties = Parquet::ReaderProperties.new
+ properties.enable_buffered_stream
+ properties.pre_buffer = false
+ properties.buffer_size = 4096
+ reader = Parquet::ArrowFileReader.new(@file.path, properties)
+ begin
+ properties.pre_buffer = true
+ properties.disable_buffered_stream
+ properties.buffer_size = 0
+ properties.unref
+ assert_equal(@table, reader.read_table)
+ ensure
+ reader.close
+ reader.unref
+ end
+ end
Review Comment:
Removed the redundant reader and Ruby tests in bce0231ff, kept the GLib
constructor coverage, and separated property assertions using the existing
`assert do` style. GLib Parquet: 70 tests pass; Red Parquet: 16 tests pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]