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