Analyzes the parameters of a CREATE TABLE statement.
(Analyzer analyzer)
| 428 | * Analyzes the parameters of a CREATE TABLE statement. |
| 429 | */ |
| 430 | void analyze(Analyzer analyzer) throws AnalysisException { |
| 431 | if (isAnalyzed_) return; |
| 432 | Preconditions.checkState(tableName_ != null && !tableName_.isEmpty()); |
| 433 | fqTableName_ = analyzer.getFqTableName(getTblName()); |
| 434 | fqTableName_.analyze(); |
| 435 | analyzeAcidProperties(analyzer); |
| 436 | analyzeColumnDefs(analyzer); |
| 437 | analyzePrimaryKeys(analyzer); |
| 438 | analyzeForeignKeys(analyzer); |
| 439 | |
| 440 | if (analyzer.dbContainsTable(getTblName().getDb(), getTbl(), Privilege.CREATE) |
| 441 | && !getIfNotExists()) { |
| 442 | throw new AnalysisException(Analyzer.TBL_ALREADY_EXISTS_ERROR_MSG + getTblName()); |
| 443 | } |
| 444 | |
| 445 | analyzer.addAccessEvent(new TAccessEvent(fqTableName_.toString(), |
| 446 | TCatalogObjectType.TABLE, Privilege.CREATE.toString())); |
| 447 | |
| 448 | Preconditions.checkNotNull(options_); |
| 449 | analyzeOptions(analyzer); |
| 450 | isAnalyzed_ = true; |
| 451 | } |
| 452 | |
| 453 | /** |
| 454 | * Analyzes table and partition column definitions, checking whether all column |
nothing calls this directly
no test coverage detected