r4ntix opened a new issue, #5731:
URL: https://github.com/apache/arrow-datafusion/issues/5731

   ### Is your feature request related to a problem or challenge?
   
   Currently we already support object store source table registration through 
sql:
   ```sql
   CREATE EXTERNAL TABLE test
   STORED AS PARQUET
   LOCATION 's3://bucket/path/file.parquet';
   ```
   
   However, some authentication information required by the object store is 
obtained through environment variables:
   ```
   AWS_ACCESS_KEY_ID -> access_key_id
   AWS_SECRET_ACCESS_KEY -> secret_access_key
   AWS_DEFAULT_REGION -> region
   AWS_ENDPOINT -> endpoint
   AWS_SESSION_TOKEN -> token
   
   $ export AWS_DEFAULT_REGION=us-east-2
   $ export AWS_SECRET_ACCESS_KEY=***************************
   $ export AWS_ACCESS_KEY_ID=**************
   $ datafusion-cli
   ```
   
   This method is not flexible, when we need to access and analyze data files 
under different accounts. We need to modify the environment variables and go 
back to the cli.
   
   ### Describe the solution you'd like
   
   We should support obtaining all relevant information when creating an object 
store tables through sql.
   Using the already supported `OPTIONS` parameter, we can do this:
   ```sql
   CREATE EXTERNAL TABLE test
   STORED AS PARQUET
   OPTIONS(
       'access_key_id' '******',
       'access_key' '******',
       'region' 'us-east-2'
   )
   LOCATION 's3://bucket/path/file.parquet';
   ```
   Also, when the user does not specify `options`, we can continue to use the 
default environment variables.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to