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