Smyatkin-Maxim opened a new pull request, #1347:
URL: https://github.com/apache/cloudberry/pull/1347

   <!-- Thank you for your contribution to Apache Cloudberry (Incubating)! -->
   
   ### What does this PR do?
   Allows LOCATION ... ON COORDINATOR syntax for file:// protocol in external 
tables.
   
   ### Additional Context
   The syntax was already there but it is not supported for any ext table 
protocols except CUSTOM. I've added support for local files. My motivation is 
use this mechanism as yet another way to read logs from the local filesystem. 
It's already possible with EXECUTE in external web tables, but for security 
reasons we prohibit it completely in our installations.
   Something like this:
   ```
   CREATE READABLE EXTERNAL TABLE pg_log_tbl_coordinator 
   (                                    
       logtime timestamp with time zone,
       loguser text,
       logdatabase text,
       logpid text,
       logthread text,
       loghost text,
       logport text,                           
       logsessiontime timestamp with time zone,
       logtransaction int,
       logsession text,
       logcmdcount text,
       logsegment text,
       logslice text,
       logdistxact text,
       loglocalxact text,
       logsubxact text,
       logseverity text,
       logstate text,
       logmessage text,
       logdetail text,
       loghint text,
       logquery text,
       logquerypos int,
       logcontext text,
       logdebug text,
       logcursorpos int,
       logfunction text,
       logfile text,
       logline int,
       logstack text
   )                                                                      
   LOCATION (
       
'file://my_local_cloudberry_build/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0/pg_log/*.csv'
 
   ) ON COORDINATOR
   FORMAT 'CSV' (DELIMITER AS ',' NULL AS '' QUOTE AS '"');
   ```
   
   ---
   <!-- Join our community:
   - Mailing list: 
[[email protected]](https://lists.apache.org/[email protected])
 (subscribe: [email protected])
   - Discussions: https://github.com/apache/cloudberry/discussions -->
   
   ### my considerations
   Let me know what you think about it. I don't think there is another security 
risk introduced by this patch cuz you already can access files on segments this 
way. Just adding coordinator to get the implementation more complete.
   However, I'm not sure why it wasn't done in the first place: simply 
forgotten/not needed or perhaps there were some concerns.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to