[ 
https://issues.apache.org/jira/browse/SPARK-24000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440841#comment-16440841
 ] 

Brahma Reddy Battula edited comment on SPARK-24000 at 4/18/18 3:41 AM:
-----------------------------------------------------------------------

Discussed [~ste...@apache.org] with offline, we feel , create table code should 
be thinking of doing a getFileStatus() on the path to see what's there and so 
fail on any no-permissions situation.

 Please forgive me,if I am not clear. I am a newbie to spark.

 

[~ste...@apache.org] can you please pitch in here.?


was (Author: brahmareddy):
Discussed [~ste...@apache.org] with offline, create table code should be 
thinking of doing a getFileStatus() on the path to see what's there and so fail 
on any no-permissions situation.

 

Please forgive me,if I am not clear. I am a newbie to spark.

> S3A: Create Table should fail on invalid AK/SK
> ----------------------------------------------
>
>                 Key: SPARK-24000
>                 URL: https://issues.apache.org/jira/browse/SPARK-24000
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Shell
>    Affects Versions: 2.3.0
>            Reporter: Brahma Reddy Battula
>            Priority: Major
>
> Currently, When we pass the i{color:#FF0000}nvalid ak&&sk{color} *create 
> table* will be the *success*.
> when the S3AFileSystem is initialized, *verifyBucketExists*() is called, 
> which will return *True* as the status code 403 
> (*_BUCKET_ACCESS_FORBIDDEN_STATUS_CODE)_*  _from following as bucket exists._
> {code:java}
> public boolean doesBucketExist(String bucketName)
>          throws AmazonClientException, AmazonServiceException {
>  
>      try {
>          headBucket(new HeadBucketRequest(bucketName));
>          return true;
>      } catch (AmazonServiceException ase) {
>          // A redirect error or a forbidden error means the bucket exists. So
>          // returning true.
>          if ((ase.getStatusCode() == Constants.BUCKET_REDIRECT_STATUS_CODE)
>                  || (ase.getStatusCode() == 
> Constants.BUCKET_ACCESS_FORBIDDEN_STATUS_CODE)) {
>              return true;
>          }
>          if (ase.getStatusCode() == Constants.NO_SUCH_BUCKET_STATUS_CODE) {
>              return false;
>          }
>          throw ase;
>  
>      }
>  }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to