red-arrow 16.1.0 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test-table.rb CHANGED
@@ -87,24 +87,26 @@ class TableTest < Test::Unit::TestCase
87
87
  target_rows_raw = [nil, true, true, false, true, false, true, true]
88
88
  target_rows = Arrow::BooleanArray.new(target_rows_raw)
89
89
  assert_equal(<<-TABLE, @table.slice(target_rows).to_s)
90
- count visible
91
- 0 2 false
92
- 1 4 (null)
93
- 2 16 true
94
- 3 64 (null)
95
- 4 128 (null)
90
+ count visible
91
+ (uint8) (bool)
92
+ 0 2 false
93
+ 1 4 (null)
94
+ 2 16 true
95
+ 3 64 (null)
96
+ 4 128 (null)
96
97
  TABLE
97
98
  end
98
99
 
99
100
  test("Array: boolean") do
100
101
  target_rows_raw = [nil, true, true, false, true, false, true, true]
101
102
  assert_equal(<<-TABLE, @table.slice(target_rows_raw).to_s)
102
- count visible
103
- 0 2 false
104
- 1 4 (null)
105
- 2 16 true
106
- 3 64 (null)
107
- 4 128 (null)
103
+ count visible
104
+ (uint8) (bool)
105
+ 0 2 false
106
+ 1 4 (null)
107
+ 2 16 true
108
+ 3 64 (null)
109
+ 4 128 (null)
108
110
  TABLE
109
111
  end
110
112
 
@@ -131,83 +133,93 @@ class TableTest < Test::Unit::TestCase
131
133
 
132
134
  test("Range: positive: include end") do
133
135
  assert_equal(<<-TABLE, @table.slice(2..4).to_s)
134
- count visible
135
- 0 4 (null)
136
- 1 8 true
137
- 2 16 true
136
+ count visible
137
+ (uint8) (bool)
138
+ 0 4 (null)
139
+ 1 8 true
140
+ 2 16 true
138
141
  TABLE
139
142
  end
140
143
 
141
144
  test("Range: positive: exclude end") do
142
145
  assert_equal(<<-TABLE, @table.slice(2...4).to_s)
143
- count visible
144
- 0 4 (null)
145
- 1 8 true
146
+ count visible
147
+ (uint8) (bool)
148
+ 0 4 (null)
149
+ 1 8 true
146
150
  TABLE
147
151
  end
148
152
 
149
153
  test("Range: negative: include end") do
150
154
  assert_equal(<<-TABLE, @table.slice(-4..-2).to_s)
151
- count visible
152
- 0 16 true
153
- 1 32 false
154
- 2 64 (null)
155
+ count visible
156
+ (uint8) (bool)
157
+ 0 16 true
158
+ 1 32 false
159
+ 2 64 (null)
155
160
  TABLE
156
161
  end
157
162
 
158
163
  test("Range: negative: exclude end") do
159
164
  assert_equal(<<-TABLE, @table.slice(-4...-2).to_s)
160
- count visible
161
- 0 16 true
162
- 1 32 false
165
+ count visible
166
+ (uint8) (bool)
167
+ 0 16 true
168
+ 1 32 false
163
169
  TABLE
164
170
  end
165
171
 
166
172
  test("[from, to]: positive") do
167
173
  assert_equal(<<-TABLE, @table.slice(0, 2).to_s)
168
- count visible
169
- 0 1 true
170
- 1 2 false
174
+ count visible
175
+ (uint8) (bool)
176
+ 0 1 true
177
+ 1 2 false
171
178
  TABLE
172
179
  end
173
180
 
174
181
  test("[from, to]: negative") do
175
182
  assert_equal(<<-TABLE, @table.slice(-4, 2).to_s)
176
- count visible
177
- 0 16 true
178
- 1 32 false
183
+ count visible
184
+ (uint8) (bool)
185
+ 0 16 true
186
+ 1 32 false
179
187
  TABLE
180
188
  end
181
189
 
182
190
  test("{key: Number}") do
183
191
  assert_equal(<<-TABLE, @table.slice(count: 16).to_s)
184
- count visible
185
- 0 16 true
192
+ count visible
193
+ (uint8) (bool)
194
+ 0 16 true
186
195
  TABLE
187
196
  end
188
197
 
189
198
  test("{key: String}") do
190
199
  table = Arrow::Table.new(name: Arrow::StringArray.new(["a", "b", "c"]))
191
200
  assert_equal(<<-TABLE, table.slice(name: 'b').to_s)
192
- name
193
- 0 b
201
+ name
202
+ (utf8)
203
+ 0 b
194
204
  TABLE
195
205
  end
196
206
 
197
207
  test("{key: true}") do
198
208
  assert_equal(<<-TABLE, @table.slice(visible: true).to_s)
199
- count visible
200
- 0 1 true
201
- 1 8 true
202
- 2 16 true
209
+ count visible
210
+ (uint8) (bool)
211
+ 0 1 true
212
+ 1 8 true
213
+ 2 16 true
203
214
  TABLE
204
215
  end
205
216
 
206
217
  test("{key: false}") do
207
218
  assert_equal(<<-TABLE, @table.slice(visible: false).to_s)
208
- count visible
209
- 0 2 false
210
- 1 32 false
219
+ count visible
220
+ (uint8) (bool)
221
+ 0 2 false
222
+ 1 32 false
211
223
  TABLE
212
224
  end
213
225
 
@@ -218,11 +230,12 @@ class TableTest < Test::Unit::TestCase
218
230
  omit("beginless range isn't supported")
219
231
  end
220
232
  assert_equal(<<-TABLE, @table.slice(count: range).to_s)
221
- count visible
222
- 0 1 true
223
- 1 2 false
224
- 2 4 (null)
225
- 3 8 true
233
+ count visible
234
+ (uint8) (bool)
235
+ 0 1 true
236
+ 1 2 false
237
+ 2 4 (null)
238
+ 3 8 true
226
239
  TABLE
227
240
  end
228
241
 
@@ -233,10 +246,11 @@ class TableTest < Test::Unit::TestCase
233
246
  omit("beginless range isn't supported")
234
247
  end
235
248
  assert_equal(<<-TABLE, @table.slice(count: range).to_s)
236
- count visible
237
- 0 1 true
238
- 1 2 false
239
- 2 4 (null)
249
+ count visible
250
+ (uint8) (bool)
251
+ 0 1 true
252
+ 1 2 false
253
+ 2 4 (null)
240
254
  TABLE
241
255
  end
242
256
 
@@ -247,39 +261,43 @@ class TableTest < Test::Unit::TestCase
247
261
  omit("endless range isn't supported")
248
262
  end
249
263
  assert_equal(<<-TABLE, @table.slice(count: range).to_s)
250
- count visible
251
- 0 16 true
252
- 1 32 false
253
- 2 64 (null)
254
- 3 128 (null)
264
+ count visible
265
+ (uint8) (bool)
266
+ 0 16 true
267
+ 1 32 false
268
+ 2 64 (null)
269
+ 3 128 (null)
255
270
  TABLE
256
271
  end
257
272
 
258
273
  test("{key: Range}: include end") do
259
274
  assert_equal(<<-TABLE, @table.slice(count: 1..16).to_s)
260
- count visible
261
- 0 1 true
262
- 1 2 false
263
- 2 4 (null)
264
- 3 8 true
265
- 4 16 true
275
+ count visible
276
+ (uint8) (bool)
277
+ 0 1 true
278
+ 1 2 false
279
+ 2 4 (null)
280
+ 3 8 true
281
+ 4 16 true
266
282
  TABLE
267
283
  end
268
284
 
269
285
  test("{key: Range}: exclude end") do
270
286
  assert_equal(<<-TABLE, @table.slice(count: 1...16).to_s)
271
- count visible
272
- 0 1 true
273
- 1 2 false
274
- 2 4 (null)
275
- 3 8 true
287
+ count visible
288
+ (uint8) (bool)
289
+ 0 1 true
290
+ 1 2 false
291
+ 2 4 (null)
292
+ 3 8 true
276
293
  TABLE
277
294
  end
278
295
 
279
296
  test("{key1: Range, key2: true}") do
280
297
  assert_equal(<<-TABLE, @table.slice(count: 0..8, visible: false).to_s)
281
- count visible
282
- 0 2 false
298
+ count visible
299
+ (uint8) (bool)
300
+ 0 2 false
283
301
  TABLE
284
302
  end
285
303
 
@@ -372,44 +390,47 @@ class TableTest < Test::Unit::TestCase
372
390
  test("add") do
373
391
  name_array = Arrow::StringArray.new(["a", "b", "c", "d", "e", "f", "g", "h"])
374
392
  assert_equal(<<-TABLE, @table.merge(:name => name_array).to_s)
375
- count visible name
376
- 0 1 true a
377
- 1 2 false b
378
- 2 4 (null) c
379
- 3 8 true d
380
- 4 16 true e
381
- 5 32 false f
382
- 6 64 (null) g
383
- 7 128 (null) h
393
+ count visible name
394
+ (uint8) (bool) (utf8)
395
+ 0 1 true a
396
+ 1 2 false b
397
+ 2 4 (null) c
398
+ 3 8 true d
399
+ 4 16 true e
400
+ 5 32 false f
401
+ 6 64 (null) g
402
+ 7 128 (null) h
384
403
  TABLE
385
404
  end
386
405
 
387
406
  test("remove") do
388
407
  assert_equal(<<-TABLE, @table.merge(:visible => nil).to_s)
389
- count
390
- 0 1
391
- 1 2
392
- 2 4
393
- 3 8
394
- 4 16
395
- 5 32
396
- 6 64
397
- 7 128
408
+ count
409
+ (uint8)
410
+ 0 1
411
+ 1 2
412
+ 2 4
413
+ 3 8
414
+ 4 16
415
+ 5 32
416
+ 6 64
417
+ 7 128
398
418
  TABLE
399
419
  end
400
420
 
401
421
  test("replace") do
402
422
  visible_array = Arrow::Int32Array.new([1] * @visible_array.length)
403
423
  assert_equal(<<-TABLE, @table.merge(:visible => visible_array).to_s)
404
- count visible
405
- 0 1 1
406
- 1 2 1
407
- 2 4 1
408
- 3 8 1
409
- 4 16 1
410
- 5 32 1
411
- 6 64 1
412
- 7 128 1
424
+ count visible
425
+ (uint8) (int32)
426
+ 0 1 1
427
+ 1 2 1
428
+ 2 4 1
429
+ 3 8 1
430
+ 4 16 1
431
+ 5 32 1
432
+ 6 64 1
433
+ 7 128 1
413
434
  TABLE
414
435
  end
415
436
  end
@@ -419,15 +440,16 @@ class TableTest < Test::Unit::TestCase
419
440
  name_array = Arrow::StringArray.new(["a", "b", "c", "d", "e", "f", "g", "h"])
420
441
  table = Arrow::Table.new("name" => name_array)
421
442
  assert_equal(<<-TABLE, @table.merge(table).to_s)
422
- count visible name
423
- 0 1 true a
424
- 1 2 false b
425
- 2 4 (null) c
426
- 3 8 true d
427
- 4 16 true e
428
- 5 32 false f
429
- 6 64 (null) g
430
- 7 128 (null) h
443
+ count visible name
444
+ (uint8) (bool) (utf8)
445
+ 0 1 true a
446
+ 1 2 false b
447
+ 2 4 (null) c
448
+ 3 8 true d
449
+ 4 16 true e
450
+ 5 32 false f
451
+ 6 64 (null) g
452
+ 7 128 (null) h
431
453
  TABLE
432
454
  end
433
455
 
@@ -435,15 +457,16 @@ class TableTest < Test::Unit::TestCase
435
457
  visible_array = Arrow::Int32Array.new([1] * @visible_array.length)
436
458
  table = Arrow::Table.new("visible" => visible_array)
437
459
  assert_equal(<<-TABLE, @table.merge(table).to_s)
438
- count visible
439
- 0 1 1
440
- 1 2 1
441
- 2 4 1
442
- 3 8 1
443
- 4 16 1
444
- 5 32 1
445
- 6 64 1
446
- 7 128 1
460
+ count visible
461
+ (uint8) (int32)
462
+ 0 1 1
463
+ 1 2 1
464
+ 2 4 1
465
+ 3 8 1
466
+ 4 16 1
467
+ 5 32 1
468
+ 6 64 1
469
+ 7 128 1
447
470
  TABLE
448
471
  end
449
472
  end
@@ -457,29 +480,31 @@ class TableTest < Test::Unit::TestCase
457
480
  sub_test_case("#remove_column") do
458
481
  test("String") do
459
482
  assert_equal(<<-TABLE, @table.remove_column("visible").to_s)
460
- count
461
- 0 1
462
- 1 2
463
- 2 4
464
- 3 8
465
- 4 16
466
- 5 32
467
- 6 64
468
- 7 128
483
+ count
484
+ (uint8)
485
+ 0 1
486
+ 1 2
487
+ 2 4
488
+ 3 8
489
+ 4 16
490
+ 5 32
491
+ 6 64
492
+ 7 128
469
493
  TABLE
470
494
  end
471
495
 
472
496
  test("Symbol") do
473
497
  assert_equal(<<-TABLE, @table.remove_column(:visible).to_s)
474
- count
475
- 0 1
476
- 1 2
477
- 2 4
478
- 3 8
479
- 4 16
480
- 5 32
481
- 6 64
482
- 7 128
498
+ count
499
+ (uint8)
500
+ 0 1
501
+ 1 2
502
+ 2 4
503
+ 3 8
504
+ 4 16
505
+ 5 32
506
+ 6 64
507
+ 7 128
483
508
  TABLE
484
509
  end
485
510
 
@@ -491,29 +516,31 @@ class TableTest < Test::Unit::TestCase
491
516
 
492
517
  test("Integer") do
493
518
  assert_equal(<<-TABLE, @table.remove_column(1).to_s)
494
- count
495
- 0 1
496
- 1 2
497
- 2 4
498
- 3 8
499
- 4 16
500
- 5 32
501
- 6 64
502
- 7 128
519
+ count
520
+ (uint8)
521
+ 0 1
522
+ 1 2
523
+ 2 4
524
+ 3 8
525
+ 4 16
526
+ 5 32
527
+ 6 64
528
+ 7 128
503
529
  TABLE
504
530
  end
505
531
 
506
532
  test("negative integer") do
507
533
  assert_equal(<<-TABLE, @table.remove_column(-1).to_s)
508
- count
509
- 0 1
510
- 1 2
511
- 2 4
512
- 3 8
513
- 4 16
514
- 5 32
515
- 6 64
516
- 7 128
534
+ count
535
+ (uint8)
536
+ 0 1
537
+ 1 2
538
+ 2 4
539
+ 3 8
540
+ 4 16
541
+ 5 32
542
+ 6 64
543
+ 7 128
517
544
  TABLE
518
545
  end
519
546
 
@@ -544,29 +571,33 @@ class TableTest < Test::Unit::TestCase
544
571
 
545
572
  test("names") do
546
573
  assert_equal(<<-TABLE, @table.select_columns(:c, :a).to_s)
547
- c a
548
- 0 1 1
574
+ c a
575
+ (uint8) (uint8)
576
+ 0 1 1
549
577
  TABLE
550
578
  end
551
579
 
552
580
  test("range") do
553
581
  assert_equal(<<-TABLE, @table.select_columns(2...4).to_s)
554
- c d
555
- 0 1 1
582
+ c d
583
+ (uint8) (uint8)
584
+ 0 1 1
556
585
  TABLE
557
586
  end
558
587
 
559
588
  test("indexes") do
560
589
  assert_equal(<<-TABLE, @table.select_columns(0, -1, 2).to_s)
561
- a e c
562
- 0 1 1 1
590
+ a e c
591
+ (uint8) (uint8) (uint8)
592
+ 0 1 1 1
563
593
  TABLE
564
594
  end
565
595
 
566
596
  test("mixed") do
567
597
  assert_equal(<<-TABLE, @table.select_columns(:a, -1, 2..3).to_s)
568
- a e c d
569
- 0 1 1 1 1
598
+ a e c d
599
+ (uint8) (uint8) (uint8) (uint8)
600
+ 0 1 1 1 1
570
601
  TABLE
571
602
  end
572
603
 
@@ -575,8 +606,9 @@ class TableTest < Test::Unit::TestCase
575
606
  column.name == "a" or i.odd?
576
607
  end
577
608
  assert_equal(<<-TABLE, selected_table.to_s)
578
- a b d
579
- 0 1 1 1
609
+ a b d
610
+ (uint8) (uint8) (uint8)
611
+ 0 1 1 1
580
612
  TABLE
581
613
  end
582
614
 
@@ -585,15 +617,17 @@ class TableTest < Test::Unit::TestCase
585
617
  column.name == "a"
586
618
  end
587
619
  assert_equal(<<-TABLE, selected_table.to_s)
588
- a
589
- 0 1
620
+ a
621
+ (uint8)
622
+ 0 1
590
623
  TABLE
591
624
  end
592
625
 
593
626
  test("empty result") do
594
627
  selected_table = @table.filter([false] * @table.size).select_columns(:a)
595
628
  assert_equal(<<-TABLE, selected_table.to_s)
596
- a
629
+ a
630
+ (uint8)
597
631
  TABLE
598
632
  end
599
633
  end
@@ -682,7 +716,7 @@ class TableTest < Test::Unit::TestCase
682
716
  output = create_output(".json")
683
717
  # TODO: Implement this.
684
718
  # @table.save(output, format: :json)
685
- columns = ""
719
+ columns = +""
686
720
  @table.each_record.each do |record|
687
721
  column = {
688
722
  "count" => record.count,
@@ -789,10 +823,11 @@ class TableTest < Test::Unit::TestCase
789
823
  path = fixture_path("with-header.csv")
790
824
  table = Arrow::Table.load(path, skip_lines: /^\#/)
791
825
  assert_equal(<<-TABLE, table.to_s)
792
- name score
793
- 0 alice 10
794
- 1 bob 29
795
- 2 chris -1
826
+ name score
827
+ (utf8) (int8)
828
+ 0 alice 10
829
+ 1 bob 29
830
+ 2 chris -1
796
831
  TABLE
797
832
  end
798
833
 
@@ -808,10 +843,11 @@ chris,-1
808
843
  CSV
809
844
  end
810
845
  assert_equal(<<-TABLE, Arrow::Table.load(file.path).to_s)
811
- name score
812
- 0 alice 10
813
- 1 bob 29
814
- 2 chris -1
846
+ name score
847
+ (utf8) (int64)
848
+ 0 alice 10
849
+ 1 bob 29
850
+ 2 chris -1
815
851
  TABLE
816
852
  end
817
853
 
@@ -826,10 +862,11 @@ chris\t-1
826
862
  file.close
827
863
  table = Arrow::Table.load(file.path)
828
864
  assert_equal(<<-TABLE, table.to_s)
829
- name score
830
- 0 alice 10
831
- 1 bob 29
832
- 2 chris -1
865
+ name score
866
+ (utf8) (int64)
867
+ 0 alice 10
868
+ 1 bob 29
869
+ 2 chris -1
833
870
  TABLE
834
871
  end
835
872
  end
@@ -881,7 +918,7 @@ chris\t-1
881
918
  output.data.to_s,
882
919
  content_type) do |port|
883
920
  input = URI("http://127.0.0.1:#{port}#{path}")
884
- loaded_table = Arrow::Table.load(input)
921
+ loaded_table = Arrow::Table.load(input, schema: @table.schema)
885
922
  assert_equal(@table.to_s, loaded_table.to_s)
886
923
  end
887
924
  end
@@ -962,15 +999,16 @@ chris\t-1
962
999
  packed_table = @table.pack
963
1000
  column_n_chunks = packed_table.columns.collect {|c| c.data.n_chunks}
964
1001
  assert_equal([[1, 1], <<-TABLE], [column_n_chunks, packed_table.to_s])
965
- count visible
966
- 0 1 true
967
- 1 2 false
968
- 2 4 (null)
969
- 3 8 true
970
- 4 16 true
971
- 5 32 false
972
- 6 64 (null)
973
- 7 128 (null)
1002
+ count visible
1003
+ (uint8) (bool)
1004
+ 0 1 true
1005
+ 1 2 false
1006
+ 2 4 (null)
1007
+ 3 8 true
1008
+ 4 16 true
1009
+ 5 32 false
1010
+ 6 64 (null)
1011
+ 7 128 (null)
974
1012
  TABLE
975
1013
  end
976
1014
 
@@ -1009,19 +1047,20 @@ visible:
1009
1047
  test(":list") do
1010
1048
  assert_equal(<<-TABLE, @table.to_s(format: :list))
1011
1049
  ==================== 0 ====================
1012
- count: 1
1013
- visible: true
1050
+ count(uint8): 1
1051
+ visible(bool): true
1014
1052
  ==================== 1 ====================
1015
- count: 2
1016
- visible: false
1053
+ count(uint8): 2
1054
+ visible(bool): false
1017
1055
  TABLE
1018
1056
  end
1019
1057
 
1020
1058
  test(":table") do
1021
1059
  assert_equal(<<-TABLE, @table.to_s(format: :table))
1022
- count visible
1023
- 0 1 true
1024
- 1 2 false
1060
+ count visible
1061
+ (uint8) (bool)
1062
+ 0 1 true
1063
+ 1 2 false
1025
1064
  TABLE
1026
1065
  end
1027
1066
 
@@ -1033,6 +1072,35 @@ visible: false
1033
1072
  end
1034
1073
  end
1035
1074
 
1075
+ sub_test_case(":show_column_type") do
1076
+ def setup
1077
+ columns = {
1078
+ "count" => Arrow::UInt8Array.new([1, 2]),
1079
+ "visible" => Arrow::BooleanArray.new([true, false]),
1080
+ }
1081
+ @table = Arrow::Table.new(columns)
1082
+ end
1083
+
1084
+ test(":list") do
1085
+ assert_equal(<<-TABLE, @table.to_s(format: :list, show_column_type: false))
1086
+ ==================== 0 ====================
1087
+ count: 1
1088
+ visible: true
1089
+ ==================== 1 ====================
1090
+ count: 2
1091
+ visible: false
1092
+ TABLE
1093
+ end
1094
+
1095
+ test(":table") do
1096
+ assert_equal(<<-TABLE, @table.to_s(format: :table, show_column_type: false))
1097
+ count visible
1098
+ 0 1 true
1099
+ 1 2 false
1100
+ TABLE
1101
+ end
1102
+ end
1103
+
1036
1104
  sub_test_case("#==") do
1037
1105
  test("Arrow::Table") do
1038
1106
  assert do
@@ -1058,13 +1126,14 @@ visible: false
1058
1126
  test("Array: boolean") do
1059
1127
  filter = [nil, true, true, false, true, false, true, true]
1060
1128
  assert_equal(<<-TABLE, @table.filter(filter, @options).to_s)
1061
- count visible
1062
- 0 (null) (null)
1063
- 1 2 false
1064
- 2 4 (null)
1065
- 3 16 true
1066
- 4 64 (null)
1067
- 5 128 (null)
1129
+ count visible
1130
+ (uint8) (bool)
1131
+ 0 (null) (null)
1132
+ 1 2 false
1133
+ 2 4 (null)
1134
+ 3 16 true
1135
+ 4 64 (null)
1136
+ 5 128 (null)
1068
1137
  TABLE
1069
1138
  end
1070
1139
 
@@ -1072,13 +1141,14 @@ visible: false
1072
1141
  array = [nil, true, true, false, true, false, true, true]
1073
1142
  filter = Arrow::BooleanArray.new(array)
1074
1143
  assert_equal(<<-TABLE, @table.filter(filter, @options).to_s)
1075
- count visible
1076
- 0 (null) (null)
1077
- 1 2 false
1078
- 2 4 (null)
1079
- 3 16 true
1080
- 4 64 (null)
1081
- 5 128 (null)
1144
+ count visible
1145
+ (uint8) (bool)
1146
+ 0 (null) (null)
1147
+ 1 2 false
1148
+ 2 4 (null)
1149
+ 3 16 true
1150
+ 4 64 (null)
1151
+ 5 128 (null)
1082
1152
  TABLE
1083
1153
  end
1084
1154
 
@@ -1090,13 +1160,14 @@ visible: false
1090
1160
  ]
1091
1161
  filter = Arrow::ChunkedArray.new(filter_chunks)
1092
1162
  assert_equal(<<-TABLE, @table.filter(filter, @options).to_s)
1093
- count visible
1094
- 0 (null) (null)
1095
- 1 2 false
1096
- 2 4 (null)
1097
- 3 16 true
1098
- 4 64 (null)
1099
- 5 128 (null)
1163
+ count visible
1164
+ (uint8) (bool)
1165
+ 0 (null) (null)
1166
+ 1 2 false
1167
+ 2 4 (null)
1168
+ 3 16 true
1169
+ 4 64 (null)
1170
+ 5 128 (null)
1100
1171
  TABLE
1101
1172
  end
1102
1173
  end
@@ -1105,20 +1176,22 @@ visible: false
1105
1176
  test("Arrow: boolean") do
1106
1177
  indices = [1, 0, 2]
1107
1178
  assert_equal(<<-TABLE, @table.take(indices).to_s)
1108
- count visible
1109
- 0 2 false
1110
- 1 1 true
1111
- 2 4 (null)
1179
+ count visible
1180
+ (uint8) (bool)
1181
+ 0 2 false
1182
+ 1 1 true
1183
+ 2 4 (null)
1112
1184
  TABLE
1113
1185
  end
1114
1186
 
1115
1187
  test("Arrow::Array") do
1116
1188
  indices = Arrow::Int16Array.new([1, 0, 2])
1117
1189
  assert_equal(<<-TABLE, @table.take(indices).to_s)
1118
- count visible
1119
- 0 2 false
1120
- 1 1 true
1121
- 2 4 (null)
1190
+ count visible
1191
+ (uint8) (bool)
1192
+ 0 2 false
1193
+ 1 1 true
1194
+ 2 4 (null)
1122
1195
  TABLE
1123
1196
  end
1124
1197
 
@@ -1129,10 +1202,11 @@ visible: false
1129
1202
  ]
1130
1203
  indices = Arrow::ChunkedArray.new(chunks)
1131
1204
  assert_equal(<<-TABLE, @table.take(indices).to_s)
1132
- count visible
1133
- 0 2 false
1134
- 1 1 true
1135
- 2 4 (null)
1205
+ count visible
1206
+ (uint8) (bool)
1207
+ 0 2 false
1208
+ 1 1 true
1209
+ 2 4 (null)
1136
1210
  TABLE
1137
1211
  end
1138
1212
  end
@@ -1144,9 +1218,10 @@ visible: false
1144
1218
  table2 = Arrow::Table.new(b: [false])
1145
1219
  concatenated = table1.concatenate([table2], unify_schemas: true)
1146
1220
  assert_equal(<<-TABLE, concatenated.to_s)
1147
- a b
1148
- 0 true false
1149
- 1 (null) false
1221
+ a b
1222
+ (bool) (bool)
1223
+ 0 true false
1224
+ 1 (null) false
1150
1225
  TABLE
1151
1226
  end
1152
1227
  end