@@ -975,29 +975,53 @@ object DeltaErrors
975
975
new AnalysisException (" Cannot describe the history of a view." )
976
976
}
977
977
978
- def copyIntoEncryptionOnlyS3 (scheme : String ): Throwable = {
978
+ def copyIntoEncryptionNotAllowedOn (scheme : String ): Throwable = {
979
+ // TODO: add `wasbs` once supported
979
980
new IllegalArgumentException (
980
- s " Invalid scheme $scheme. COPY INTO source encryption is only supported for S3 paths. " )
981
+ s " Invalid scheme $scheme. " +
982
+ s " COPY INTO source encryption currently only supports s3/s3n/s3a/abfss. " )
981
983
}
982
984
983
985
def copyIntoEncryptionSseCRequired (): Throwable = {
984
986
new IllegalArgumentException (
985
- s " Invalid encryption type. COPY INTO source encryption must specify 'type ' = 'SSE-C '. " )
987
+ s " Invalid encryption type. COPY INTO source encryption must specify 'TYPE ' = 'AWS_SSE_C '. " )
986
988
}
987
989
988
990
def copyIntoEncryptionMasterKeyRequired (): Throwable = {
989
991
new IllegalArgumentException (
990
- s " Invalid encryption arguments. COPY INTO source encryption must specify a masterKey . " )
992
+ s " Invalid encryption arguments. COPY INTO source encryption must specify a MASTER_KEY . " )
991
993
}
992
994
993
- def copyIntoCredentialsOnlyS3 (scheme : String ): Throwable = {
995
+ def copyIntoCredentialsNotAllowedOn (scheme : String ): Throwable = {
996
+ new IllegalArgumentException (
997
+ s " Invalid scheme $scheme. " +
998
+ s " COPY INTO source encryption currently only supports s3/s3n/s3a/wasbs/abfss. " )
999
+ }
1000
+
1001
+ def copyIntoCredentialsAllRequiredForS3 (cause : Throwable ): Throwable = {
1002
+ new IllegalArgumentException (
1003
+ " COPY INTO credentials must include AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_SESSION_TOKEN." ,
1004
+ cause)
1005
+ }
1006
+
1007
+ def copyIntoEncryptionRequiredForAzure (key : String , value : Option [String ] = None ): Throwable = {
994
1008
new IllegalArgumentException (
995
- s " Invalid scheme $scheme. COPY INTO source credentials are only supported for S3 paths. " )
1009
+ if (value.nonEmpty) {
1010
+ s " Invalid encryption option $key. " +
1011
+ s " COPY INTO source encryption must specify ' $key' = ' ${value.get}'. "
1012
+ } else {
1013
+ s " COPY INTO source encryption must specify ' $key'. "
1014
+ }
1015
+ )
996
1016
}
997
1017
998
- def copyIntoCredentialsAllRequired ( cause : Throwable ) : Throwable = {
1018
+ def copyIntoEncryptionNotSupportedForAzure : Throwable = {
999
1019
new IllegalArgumentException (
1000
- " COPY INTO credentials must include awsKeyId, awsSecretKey, and awsSessionToken." , cause)
1020
+ " COPY INTO encryption only supports ADLS Gen2, or abfss:// file scheme" )
1021
+ }
1022
+
1023
+ def copyIntoCredentialsRequiredForAzure (key : String ): Throwable = {
1024
+ new IllegalArgumentException (s " COPY INTO source credentials must specify ' $key'. " )
1001
1025
}
1002
1026
1003
1027
def postCommitHookFailedException (
0 commit comments