001package gudusoft.gsqlparser.stmt.hive; 002/* 003 * Date: 13-7-29 004 */ 005 006import gudusoft.gsqlparser.EDbVendor; 007import gudusoft.gsqlparser.ESqlStatementType; 008import gudusoft.gsqlparser.TCustomSqlStatement; 009import gudusoft.gsqlparser.nodes.TObjectName; 010import gudusoft.gsqlparser.nodes.TParseTreeVisitor; 011import gudusoft.gsqlparser.nodes.hive.*; 012 013public class THiveDescribe extends TCustomSqlStatement { 014 015 private EHiveDescribleType describleType; 016 private TObjectName functionName; 017 private TObjectName dbName; 018 private THiveDescTablePartition tablePartition; 019 private EHiveDescOption descOption; 020 021 022 public THiveDescribe(EDbVendor dbvendor) { 023 super(dbvendor); 024 sqlstatementtype = ESqlStatementType.ssthiveDesc; 025 } 026 027 public TObjectName getDbName() { 028 return dbName; 029 } 030 031 public EHiveDescOption getDescOption() { 032 return descOption; 033 } 034 035 public EHiveDescribleType getDescribleType() { 036 return describleType; 037 } 038 039 public TObjectName getFunctionName() { 040 return functionName; 041 } 042 043 public THiveDescTablePartition getTablePartition() { 044 return tablePartition; 045 } 046 047 public int doParseStatement(TCustomSqlStatement psql) { 048 if (rootNode == null) return -1; 049 super.doParseStatement(psql); 050 THiveDescribeSqlNode node = (THiveDescribeSqlNode)rootNode; 051 052 this.dbName = node.getDbName(); 053 this.functionName = node.getDbName(); 054 this.descOption = node.getDescOption(); 055 this.tablePartition = node.getTablePartition(); 056 this.describleType = node.getDescribleType(); 057 058 059 060 return 0; 061 } 062 063 public void accept(TParseTreeVisitor v){ 064 v.preVisit(this); 065 v.postVisit(this); 066 } 067 068 public void acceptChildren(TParseTreeVisitor v){ 069 v.preVisit(this); 070 v.postVisit(this); 071 } 072 073 public void setDescribleType(EHiveDescribleType describleType) { 074 this.describleType = describleType; 075 } 076 077 public void setFunctionName(TObjectName functionName) { 078 this.functionName = functionName; 079 } 080 081 public void setDbName(TObjectName dbName) { 082 this.dbName = dbName; 083 } 084 085 public void setTablePartition(THiveDescTablePartition tablePartition) { 086 this.tablePartition = tablePartition; 087 } 088 089 public void setDescOption(EHiveDescOption descOption) { 090 this.descOption = descOption; 091 } 092}