MCPcopy Create free account
hub / github.com/apache/arrow / test_json

Method test_json

ruby/red-arrow/test/test-table.rb:715–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713 end
714
715 def test_json
716 output = create_output(".json")
717 # TODO: Implement this.
718 # @table.save(output, format: :json)
719 columns = +""
720 @table.each_record.each do |record|
721 column = {
722 "count" => record.count,
723 "visible" => record.visible,
724 }
725 columns << column.to_json
726 columns << "\n"
727 end
728 if output.is_a?(String)
729 File.write(output, columns)
730 else
731 output.resize(columns.bytesize)
732 output.set_data(0, columns)
733 end
734 assert_equal(@table,
735 Arrow::Table.load(output,
736 format: :json,
737 schema: @table.schema))
738 end
739 end
740
741 sub_test_case("path") do

Callers

nothing calls this directly

Calls 7

each_recordMethod · 0.80
resizeMethod · 0.80
eachMethod · 0.45
countMethod · 0.45
writeMethod · 0.45
loadMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected