001package gudusoft.gsqlparser.nodes; 002 003import gudusoft.gsqlparser.TSourceToken; 004import gudusoft.gsqlparser.nodes.flink.TFlinkTableProperty; 005 006/** 007 * AST node for StarRocks EXPORT statement. 008 * 009 * Syntax: 010 * EXPORT TABLE <table_name> 011 * [PARTITION (<partition_name>[, ...])] 012 * [(<column_name>[, ...])] 013 * TO <export_path> 014 * [PROPERTIES ("<key>"="<value>", ...)] 015 * WITH BROKER [broker_name] [(broker_properties)] 016 * 017 * Example: 018 * EXPORT TABLE db.table_name 019 * PARTITION (p1, p2) 020 * (col1, col2) 021 * TO 's3://bucket/path/' 022 * PROPERTIES ( 023 * "column_separator" = ",", 024 * "line_delimiter" = "\n" 025 * ) 026 * WITH BROKER 027 * ( 028 * "aws.s3.access_key" = "xxx", 029 * "aws.s3.secret_key" = "yyy", 030 * "aws.s3.region" = "us-west-2" 031 * ); 032 */ 033public class TExportSqlNode extends TParseTreeNode { 034 // Table identification 035 private TObjectName tableName; 036 037 // Optional partition specification 038 private TObjectNameList partitionList; 039 040 // Optional column list 041 private TObjectNameList columnList; 042 043 // Export path (TO clause) 044 private TSourceToken exportPath; 045 046 // Export properties (PROPERTIES clause) 047 private TParseTreeNode exportProperties; 048 049 // Broker name (optional with WITH BROKER) 050 private TObjectName brokerName; 051 052 // Broker properties 053 private TParseTreeNode brokerProperties; 054 055 // Getters and setters 056 public TObjectName getTableName() { 057 return tableName; 058 } 059 060 public void setTableName(TObjectName tableName) { 061 this.tableName = tableName; 062 } 063 064 public TObjectNameList getPartitionList() { 065 return partitionList; 066 } 067 068 public void setPartitionList(TObjectNameList partitionList) { 069 this.partitionList = partitionList; 070 } 071 072 public TObjectNameList getColumnList() { 073 return columnList; 074 } 075 076 public void setColumnList(TObjectNameList columnList) { 077 this.columnList = columnList; 078 } 079 080 public TSourceToken getExportPath() { 081 return exportPath; 082 } 083 084 public void setExportPath(TSourceToken exportPath) { 085 this.exportPath = exportPath; 086 } 087 088 @SuppressWarnings("unchecked") 089 public TPTNodeList<TFlinkTableProperty> getExportProperties() { 090 return (TPTNodeList<TFlinkTableProperty>) exportProperties; 091 } 092 093 public void setExportProperties(TParseTreeNode exportProperties) { 094 this.exportProperties = exportProperties; 095 } 096 097 public TObjectName getBrokerName() { 098 return brokerName; 099 } 100 101 public void setBrokerName(TObjectName brokerName) { 102 this.brokerName = brokerName; 103 } 104 105 @SuppressWarnings("unchecked") 106 public TPTNodeList<TFlinkTableProperty> getBrokerProperties() { 107 return (TPTNodeList<TFlinkTableProperty>) brokerProperties; 108 } 109 110 public void setBrokerProperties(TParseTreeNode brokerProperties) { 111 this.brokerProperties = brokerProperties; 112 } 113 114 public void init(Object arg1) { 115 this.tableName = (TObjectName) arg1; 116 } 117}