|
95 | 95 |
|
96 | 96 | public class TrinoQueryProperties |
97 | 97 | { |
| 98 | + public static final String TRINO_CATALOG_HEADER_NAME = "X-Trino-Catalog"; |
| 99 | + public static final String TRINO_SCHEMA_HEADER_NAME = "X-Trino-Schema"; |
| 100 | + public static final String TRINO_PREPARED_STATEMENT_HEADER_NAME = "X-Trino-Prepared-Statement"; |
| 101 | + |
98 | 102 | private final Logger log = Logger.get(TrinoQueryProperties.class); |
99 | 103 | private final boolean isClientsUseV2Format; |
100 | 104 | private final int maxBodySize; |
| 105 | + private final Optional<String> defaultCatalog; |
| 106 | + private final Optional<String> defaultSchema; |
| 107 | + private final ZstdDecompressor decompressor = ZstdDecompressor.create(); |
| 108 | + |
101 | 109 | private String body = ""; |
102 | 110 | private String queryType = ""; |
103 | 111 | private String resourceGroupQueryType = ""; |
104 | 112 | private Set<QualifiedName> tables = ImmutableSet.of(); |
105 | | - private final Optional<String> defaultCatalog; |
106 | | - private final Optional<String> defaultSchema; |
107 | 113 | private Set<String> catalogs = ImmutableSet.of(); |
108 | 114 | private Set<String> schemas = ImmutableSet.of(); |
109 | 115 | private Set<String> catalogSchemas = ImmutableSet.of(); |
110 | 116 | private boolean isNewQuerySubmission; |
111 | 117 | private Optional<String> errorMessage = Optional.empty(); |
112 | 118 | private Optional<String> queryId = Optional.empty(); |
113 | | - private final ZstdDecompressor decompressor = ZstdDecompressor.create(); |
114 | | - |
115 | | - public static final String TRINO_CATALOG_HEADER_NAME = "X-Trino-Catalog"; |
116 | | - public static final String TRINO_SCHEMA_HEADER_NAME = "X-Trino-Schema"; |
117 | | - public static final String TRINO_PREPARED_STATEMENT_HEADER_NAME = "X-Trino-Prepared-Statement"; |
118 | 119 |
|
119 | 120 | @JsonCreator |
120 | 121 | public TrinoQueryProperties( |
@@ -487,8 +488,7 @@ private QualifiedName qualifyName(QualifiedName name) |
487 | 488 | { |
488 | 489 | List<String> nameParts = name.getParts(); |
489 | 490 | return switch (nameParts.size()) { |
490 | | - case 1 -> |
491 | | - QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), defaultSchema.orElseThrow(this::unsetDefaultExceptionSupplier), nameParts.getFirst()); |
| 491 | + case 1 -> QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), defaultSchema.orElseThrow(this::unsetDefaultExceptionSupplier), nameParts.getFirst()); |
492 | 492 | case 2 -> QualifiedName.of(defaultCatalog.orElseThrow(this::unsetDefaultExceptionSupplier), nameParts.getFirst(), nameParts.get(1)); |
493 | 493 | case 3 -> QualifiedName.of(nameParts.getFirst(), nameParts.get(1), nameParts.get(2)); |
494 | 494 | default -> throw new RequestParsingException("Unexpected qualified name: " + name.getParts()); |
|
0 commit comments