|
16 | 16 | import com.facebook.presto.common.QualifiedObjectName; |
17 | 17 | import com.facebook.presto.spi.PrestoException; |
18 | 18 | import com.facebook.presto.sql.analyzer.SemanticException; |
| 19 | +import com.facebook.presto.sql.tree.Identifier; |
19 | 20 | import com.facebook.presto.sql.tree.Node; |
20 | 21 | import com.facebook.presto.sql.tree.QualifiedName; |
21 | 22 | import com.google.common.collect.Lists; |
@@ -46,11 +47,11 @@ public static QualifiedObjectName createQualifiedObjectName(Optional<String> ses |
46 | 47 | throw new PrestoException(SYNTAX_ERROR, format("Too many dots in table name: %s", name)); |
47 | 48 | } |
48 | 49 |
|
49 | | - List<String> parts = Lists.reverse(name.getParts()); |
50 | | - String objectName = parts.get(0); |
51 | | - String schemaName = (parts.size() > 1) ? parts.get(1) : sessionSchemaName.orElseThrow(() -> |
| 50 | + List<Identifier> parts = Lists.reverse(name.getOriginalParts()); |
| 51 | + String objectName = parts.get(0).getValue(); |
| 52 | + String schemaName = (parts.size() > 1) ? parts.get(1).getValue() : sessionSchemaName.orElseThrow(() -> |
52 | 53 | new SemanticException(SCHEMA_NOT_SPECIFIED, node, "Schema must be specified when session schema is not set")); |
53 | | - String catalogName = (parts.size() > 2) ? parts.get(2) : sessionCatalogName.orElseThrow(() -> |
| 54 | + String catalogName = (parts.size() > 2) ? parts.get(2).getValue() : sessionCatalogName.orElseThrow(() -> |
54 | 55 | new SemanticException(CATALOG_NOT_SPECIFIED, node, "Catalog must be specified when session catalog is not set")); |
55 | 56 |
|
56 | 57 | catalogName = catalogName.toLowerCase(ENGLISH); |
|
0 commit comments