You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Table with the different combination of column types
514
+
statement ok
515
+
create table test as
516
+
SELECT
517
+
arrow_cast(column1, 'Utf8') as column1_utf8,
518
+
arrow_cast(column2, 'Utf8') as column2_utf8,
519
+
arrow_cast(column1, 'LargeUtf8') as column1_large_utf8,
520
+
arrow_cast(column2, 'LargeUtf8') as column2_large_utf8,
521
+
arrow_cast(column1, 'Utf8View') as column1_utf8view,
522
+
arrow_cast(column2, 'Utf8View') as column2_utf8view
523
+
FROM test_source;
524
+
525
+
# Test ASCII with utf8view against utf8view, utf8, and largeutf8
526
+
# (should be no casts)
527
+
query TT
528
+
EXPLAIN SELECT
529
+
ASCII(column1_utf8view) as c1,
530
+
ASCII(column2_utf8) as c2,
531
+
ASCII(column2_large_utf8) as c3
532
+
FROM test;
533
+
----
534
+
logical_plan
535
+
01)Projection: ascii(test.column1_utf8view) AS c1, ascii(test.column2_utf8) AS c2, ascii(test.column2_large_utf8) AS c3
536
+
02)--TableScan: test projection=[column2_utf8, column2_large_utf8, column1_utf8view]
537
+
538
+
query III
539
+
SELECT
540
+
ASCII(column1_utf8view) as c1,
541
+
ASCII(column2_utf8) as c2,
542
+
ASCII(column2_large_utf8) as c3
543
+
FROM test;
544
+
----
545
+
65 88 88
546
+
88 88 88
547
+
82 82 82
548
+
NULL 82 82
549
+
550
+
query TT
551
+
EXPLAIN SELECT
552
+
ASCII(column1_utf8) as c1,
553
+
ASCII(column1_large_utf8) as c2,
554
+
ASCII(column2_utf8view) as c3,
555
+
ASCII('hello') as c4,
556
+
ASCII(arrow_cast('world', 'Utf8View')) as c5
557
+
FROM test;
558
+
----
559
+
logical_plan
560
+
01)Projection: ascii(test.column1_utf8) AS c1, ascii(test.column1_large_utf8) AS c2, ascii(test.column2_utf8view) AS c3, Int32(104) AS c4, Int32(119) AS c5
561
+
02)--TableScan: test projection=[column1_utf8, column1_large_utf8, column2_utf8view]
562
+
563
+
query IIIII
564
+
SELECT
565
+
ASCII(column1_utf8) as c1,
566
+
ASCII(column1_large_utf8) as c2,
567
+
ASCII(column2_utf8view) as c3,
568
+
ASCII('hello') as c4,
569
+
ASCII(arrow_cast('world', 'Utf8View')) as c5
570
+
FROM test;
571
+
----
572
+
65 65 88 104 119
573
+
88 88 88 104 119
574
+
82 82 82 104 119
575
+
NULL NULL 82 104 119
576
+
577
+
# Test ASCII with literals cast to Utf8View
578
+
query TT
579
+
EXPLAIN SELECT
580
+
ASCII(arrow_cast('äöüß', 'Utf8View')) as c1,
581
+
ASCII(arrow_cast('', 'Utf8View')) as c2,
582
+
ASCII(arrow_cast(NULL, 'Utf8View')) as c3
583
+
FROM test;
584
+
----
585
+
logical_plan
586
+
01)Projection: Int32(228) AS c1, Int32(0) AS c2, Int32(NULL) AS c3
0 commit comments