@@ -592,15 +592,15 @@ class CastSuite extends CastSuiteBase {
592592 val e1 = intercept[ArithmeticException ] {
593593 Cast (Literal (Byte .MaxValue + 1 ), ByteType ).eval()
594594 }.getMessage
595- assert(e1.contains(" Casting 128 to TINYINT causes overflow" ))
595+ assert(e1.contains(" Casting 128 to \" TINYINT\" causes overflow" ))
596596 val e2 = intercept[ArithmeticException ] {
597597 Cast (Literal (Short .MaxValue + 1 ), ShortType ).eval()
598598 }.getMessage
599- assert(e2.contains(" Casting 32768 to SMALLINT causes overflow" ))
599+ assert(e2.contains(" Casting 32768 to \" SMALLINT\" causes overflow" ))
600600 val e3 = intercept[ArithmeticException ] {
601601 Cast (Literal (Int .MaxValue + 1L ), IntegerType ).eval()
602602 }.getMessage
603- assert(e3.contains(" Casting 2147483648L to INT causes overflow" ))
603+ assert(e3.contains(" Casting 2147483648L to \" INT\" causes overflow" ))
604604 }
605605 }
606606
@@ -642,15 +642,15 @@ class CastSuite extends CastSuiteBase {
642642 checkEvaluation(cast(v2, LongType ), 25L )
643643 case MINUTE =>
644644 checkExceptionInExpression[ArithmeticException ](cast(v2, ByteType ),
645- s " Casting $v2 to TINYINT causes overflow " )
645+ s """ Casting $v2 to " TINYINT" causes overflow "" " )
646646 checkEvaluation(cast(v2, ShortType ), (MINUTES_PER_HOUR * 25 + 1 ).toShort)
647647 checkEvaluation(cast(v2, IntegerType ), (MINUTES_PER_HOUR * 25 + 1 ).toInt)
648648 checkEvaluation(cast(v2, LongType ), MINUTES_PER_HOUR * 25 + 1 )
649649 case SECOND =>
650650 checkExceptionInExpression[ArithmeticException ](cast(v2, ByteType ),
651- s " Casting $v2 to TINYINT causes overflow " )
651+ s """ Casting $v2 to " TINYINT" causes overflow "" " )
652652 checkExceptionInExpression[ArithmeticException ](cast(v2, ShortType ),
653- s " Casting $v2 to SMALLINT causes overflow " )
653+ s """ Casting $v2 to " SMALLINT" causes overflow "" " )
654654 checkEvaluation(cast(v2, IntegerType ), num.toInt)
655655 checkEvaluation(cast(v2, LongType ), num)
656656 }
@@ -659,69 +659,69 @@ class CastSuite extends CastSuiteBase {
659659 dt.endField match {
660660 case DAY =>
661661 checkExceptionInExpression[ArithmeticException ](cast(v3, ByteType ),
662- s " Casting $v3 to TINYINT causes overflow " )
662+ s """ Casting $v3 to " TINYINT" causes overflow "" " )
663663 checkExceptionInExpression[ArithmeticException ](cast(v3, ShortType ),
664- s " Casting $v3 to SMALLINT causes overflow " )
664+ s """ Casting $v3 to " SMALLINT" causes overflow "" " )
665665 checkEvaluation(cast(v3, IntegerType ), (Long .MaxValue / MICROS_PER_DAY ).toInt)
666666 checkEvaluation(cast(v3, LongType ), Long .MaxValue / MICROS_PER_DAY )
667667 case HOUR =>
668668 checkExceptionInExpression[ArithmeticException ](cast(v3, ByteType ),
669- s " Casting $v3 to TINYINT causes overflow " )
669+ s """ Casting $v3 to " TINYINT" causes overflow "" " )
670670 checkExceptionInExpression[ArithmeticException ](cast(v3, ShortType ),
671- s " Casting $v3 to SMALLINT causes overflow " )
671+ s """ Casting $v3 to " SMALLINT" causes overflow "" " )
672672 checkExceptionInExpression[ArithmeticException ](cast(v3, IntegerType ),
673- s " Casting $v3 to INT causes overflow " )
673+ s """ Casting $v3 to " INT" causes overflow "" " )
674674 checkEvaluation(cast(v3, LongType ), Long .MaxValue / MICROS_PER_HOUR )
675675 case MINUTE =>
676676 checkExceptionInExpression[ArithmeticException ](cast(v3, ByteType ),
677- s " Casting $v3 to TINYINT causes overflow " )
677+ s """ Casting $v3 to " TINYINT" causes overflow "" " )
678678 checkExceptionInExpression[ArithmeticException ](cast(v3, ShortType ),
679- s " Casting $v3 to SMALLINT causes overflow " )
679+ s """ Casting $v3 to " SMALLINT" causes overflow "" " )
680680 checkExceptionInExpression[ArithmeticException ](cast(v3, IntegerType ),
681- s " Casting $v3 to INT causes overflow " )
681+ s """ Casting $v3 to " INT" causes overflow "" " )
682682 checkEvaluation(cast(v3, LongType ), Long .MaxValue / MICROS_PER_MINUTE )
683683 case SECOND =>
684684 checkExceptionInExpression[ArithmeticException ](cast(v3, ByteType ),
685- s " Casting $v3 to TINYINT causes overflow " )
685+ s """ Casting $v3 to " TINYINT" causes overflow "" " )
686686 checkExceptionInExpression[ArithmeticException ](cast(v3, ShortType ),
687- s " Casting $v3 to SMALLINT causes overflow " )
687+ s """ Casting $v3 to " SMALLINT" causes overflow "" " )
688688 checkExceptionInExpression[ArithmeticException ](cast(v3, IntegerType ),
689- s " Casting $v3 to INT causes overflow " )
689+ s """ Casting $v3 to " INT" causes overflow "" " )
690690 checkEvaluation(cast(v3, LongType ), Long .MaxValue / MICROS_PER_SECOND )
691691 }
692692
693693 val v4 = Literal .create(Duration .of(Long .MinValue , ChronoUnit .MICROS ), dt)
694694 dt.endField match {
695695 case DAY =>
696696 checkExceptionInExpression[ArithmeticException ](cast(v4, ByteType ),
697- s " Casting $v4 to TINYINT causes overflow " )
697+ s """ Casting $v4 to " TINYINT" causes overflow "" " )
698698 checkExceptionInExpression[ArithmeticException ](cast(v4, ShortType ),
699- s " Casting $v4 to SMALLINT causes overflow " )
699+ s """ Casting $v4 to " SMALLINT" causes overflow "" " )
700700 checkEvaluation(cast(v4, IntegerType ), (Long .MinValue / MICROS_PER_DAY ).toInt)
701701 checkEvaluation(cast(v4, LongType ), Long .MinValue / MICROS_PER_DAY )
702702 case HOUR =>
703703 checkExceptionInExpression[ArithmeticException ](cast(v4, ByteType ),
704- s " Casting $v4 to TINYINT causes overflow " )
704+ s """ Casting $v4 to " TINYINT" causes overflow "" " )
705705 checkExceptionInExpression[ArithmeticException ](cast(v4, ShortType ),
706- s " Casting $v4 to SMALLINT causes overflow " )
706+ s """ Casting $v4 to " SMALLINT" causes overflow "" " )
707707 checkExceptionInExpression[ArithmeticException ](cast(v4, IntegerType ),
708- s " Casting $v4 to INT causes overflow " )
708+ s """ Casting $v4 to " INT" causes overflow "" " )
709709 checkEvaluation(cast(v4, LongType ), Long .MinValue / MICROS_PER_HOUR )
710710 case MINUTE =>
711711 checkExceptionInExpression[ArithmeticException ](cast(v4, ByteType ),
712- s " Casting $v4 to TINYINT causes overflow " )
712+ s """ Casting $v4 to " TINYINT" causes overflow "" " )
713713 checkExceptionInExpression[ArithmeticException ](cast(v4, ShortType ),
714- s " Casting $v4 to SMALLINT causes overflow " )
714+ s """ Casting $v4 to " SMALLINT" causes overflow "" " )
715715 checkExceptionInExpression[ArithmeticException ](cast(v4, IntegerType ),
716- s " Casting $v4 to INT causes overflow " )
716+ s """ Casting $v4 to " INT" causes overflow "" " )
717717 checkEvaluation(cast(v4, LongType ), Long .MinValue / MICROS_PER_MINUTE )
718718 case SECOND =>
719719 checkExceptionInExpression[ArithmeticException ](cast(v4, ByteType ),
720- s " Casting $v4 to TINYINT causes overflow " )
720+ s """ Casting $v4 to " TINYINT" causes overflow "" " )
721721 checkExceptionInExpression[ArithmeticException ](cast(v4, ShortType ),
722- s " Casting $v4 to SMALLINT causes overflow " )
722+ s """ Casting $v4 to " SMALLINT" causes overflow "" " )
723723 checkExceptionInExpression[ArithmeticException ](cast(v4, IntegerType ),
724- s " Casting $v4 to INT causes overflow " )
724+ s """ Casting $v4 to " INT" causes overflow "" " )
725725 checkEvaluation(cast(v4, LongType ), Long .MinValue / MICROS_PER_SECOND )
726726 }
727727 }
@@ -777,7 +777,7 @@ class CastSuite extends CastSuiteBase {
777777 ).foreach {
778778 case (v, toType) =>
779779 checkExceptionInExpression[ArithmeticException ](cast(v, toType),
780- s " Casting $v to ${toType.sql} causes overflow " )
780+ s """ Casting $v to " ${toType.sql}" causes overflow"" " )
781781 }
782782
783783 Seq (
@@ -792,7 +792,7 @@ class CastSuite extends CastSuiteBase {
792792 ).foreach {
793793 case (v, toType) =>
794794 checkExceptionInExpression[ArithmeticException ](cast(v, toType),
795- s " Casting ${v}L to ${toType.sql} causes overflow " )
795+ s """ Casting ${v}L to " ${toType.sql}" causes overflow"" " )
796796 }
797797 }
798798
@@ -829,7 +829,7 @@ class CastSuite extends CastSuiteBase {
829829 case (v, dt, toType) =>
830830 val value = Literal .create(v, dt)
831831 checkExceptionInExpression[ArithmeticException ](cast(value, toType),
832- s " Casting $value to ${toType.sql} causes overflow " )
832+ s """ Casting $value to " ${toType.sql}" causes overflow"" " )
833833 }
834834
835835 Seq (
@@ -887,7 +887,7 @@ class CastSuite extends CastSuiteBase {
887887 ).foreach {
888888 case (v, toType) =>
889889 checkExceptionInExpression[ArithmeticException ](cast(v, toType),
890- s " Casting $v to ${toType.sql} causes overflow " )
890+ s """ Casting $v to " ${toType.sql}" causes overflow"" " )
891891 }
892892
893893 Seq (
@@ -898,7 +898,7 @@ class CastSuite extends CastSuiteBase {
898898 ).foreach {
899899 case (v, toType) =>
900900 checkExceptionInExpression[ArithmeticException ](cast(v, toType),
901- s " Casting ${v}L to ${toType.sql} causes overflow " )
901+ s """ Casting ${v}L to " ${toType.sql}" causes overflow"" " )
902902 }
903903 }
904904}
0 commit comments