Skip to content

Commit

Permalink
chore(web-console): use a new information_schema.questdb_columns() in…
Browse files Browse the repository at this point in the history
…stead of information_schema.columns() (#359)

chore(web-console): use a new information_schema.questdb_columns() instead of information_schema.columns()

required due to questdb/questdb#5206

---------

Co-authored-by: Maciej Bodek <[email protected]>
  • Loading branch information
jerrinot and insmac authored Nov 29, 2024
1 parent 76cfb5d commit 382e22a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/browser-tests/questdb
Submodule questdb updated 51 files
+3 −2 ci/templates/start-self-hosted-job.yml
+3 −3 ci/test-pipeline.yml
+1 −1 core/pom.xml
+10 −1 core/src/main/java/io/questdb/cairo/AbstractTableNameRegistry.java
+4 −4 core/src/main/java/io/questdb/cairo/CairoEngine.java
+6 −1 core/src/main/java/io/questdb/cairo/CairoException.java
+0 −3 core/src/main/java/io/questdb/cairo/DdlListener.java
+10 −2 core/src/main/java/io/questdb/cairo/TableNameRegistry.java
+42 −10 core/src/main/java/io/questdb/cairo/wal/ApplyWal2TableJob.java
+0 −4 core/src/main/java/io/questdb/cairo/wal/WalWriter.java
+21 −23 core/src/main/java/io/questdb/cutlass/pgwire/modern/PGConnectionContextModern.java
+198 −102 core/src/main/java/io/questdb/cutlass/pgwire/modern/PGPipelineEntry.java
+3 −3 core/src/main/java/io/questdb/griffin/QueryBuilder.java
+44 −27 core/src/main/java/io/questdb/griffin/SqlCompilerImpl.java
+13 −2 core/src/main/java/io/questdb/griffin/SqlException.java
+21 −13 core/src/main/java/io/questdb/griffin/SqlParser.java
+8 −8 core/src/main/java/io/questdb/griffin/SqlParserCallback.java
+94 −82 core/src/main/java/io/questdb/griffin/engine/functions/date/TimestampAddFunctionFactory.java
+57 −1 core/src/main/java/io/questdb/griffin/engine/functions/window/AbstractWindowFunctionFactory.java
+7 −38 core/src/main/java/io/questdb/griffin/engine/functions/window/AvgDoubleWindowFunctionFactory.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/functions/window/CountConstWindowFunctionFactory.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/functions/window/CountDoubleWindowFunctionFactory.java
+8 −37 core/src/main/java/io/questdb/griffin/engine/functions/window/CountFunctionFactoryHelper.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/functions/window/CountSymbolWindowFunctionFactory.java
+1 −2 core/src/main/java/io/questdb/griffin/engine/functions/window/CountVarcharWindowFunctionFactory.java
+7 −35 core/src/main/java/io/questdb/griffin/engine/functions/window/FirstValueDoubleWindowFunctionFactory.java
+1,703 −0 core/src/main/java/io/questdb/griffin/engine/functions/window/MaxDoubleWindowFunctionFactory.java
+327 −0 core/src/main/java/io/questdb/griffin/engine/functions/window/MinDoubleWindowFunctionFactory.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/functions/window/SumDoubleWindowFunctionFactory.java
+16 −581 core/src/main/java/io/questdb/griffin/engine/ops/CreateTableOperation.java
+7 −408 core/src/main/java/io/questdb/griffin/engine/ops/CreateTableOperationBuilder.java
+413 −0 core/src/main/java/io/questdb/griffin/engine/ops/CreateTableOperationBuilderImpl.java
+11 −0 core/src/main/java/io/questdb/griffin/engine/ops/CreateTableOperationFuture.java
+618 −0 core/src/main/java/io/questdb/griffin/engine/ops/CreateTableOperationImpl.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/ops/GenericDropOperation.java
+3 −0 core/src/main/java/io/questdb/std/str/Utf8s.java
+2 −0 core/src/main/java/module-info.java
+2 −0 core/src/main/resources/META-INF/services/io.questdb.griffin.FunctionFactory
+2 −2 core/src/test/java/io/questdb/test/cairo/CreateTableTest.java
+3 −0 core/src/test/java/io/questdb/test/cairo/TableNameRegistryTest.java
+239 −0 core/src/test/java/io/questdb/test/cutlass/http/QueryRegistryTest.java
+61 −16 core/src/test/java/io/questdb/test/cutlass/pgwire/PreparedStatementInvalidationTest.java
+13 −0 core/src/test/java/io/questdb/test/griffin/CreateTableAsSelectTest.java
+86 −0 core/src/test/java/io/questdb/test/griffin/DropTableFuzzTest.java
+2 −2 core/src/test/java/io/questdb/test/griffin/GroupByTest.java
+7 −2 core/src/test/java/io/questdb/test/griffin/SqlCompilerImplTest.java
+1 −1 core/src/test/java/io/questdb/test/griffin/SqlParserTest.java
+46 −357 core/src/test/java/io/questdb/test/griffin/engine/functions/date/TimestampAddFunctionFactoryTest.java
+873 −659 core/src/test/java/io/questdb/test/griffin/engine/window/WindowFunctionTest.java
+420 −11 core/src/test/java/io/questdb/test/griffin/engine/window/WindowFunctionUnitTest.java
+60 −0 core/src/test/resources/sqllogictest/test/sql/test_update_rename_wal_table.test
30 changes: 19 additions & 11 deletions packages/web-console/src/scenes/Schema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,29 @@ const Schema = ({
}

const fetchColumns = async () => {
try {
const response = await quest.query<QuestDB.InformationSchemaColumn>(
"information_schema.columns()",
)
if (response && response && response.type === QuestDB.Type.DQL) {
setColumns(response.data)
dispatch(actions.query.setColumns(response.data))
const queries = [
"information_schema.questdb_columns()",
"information_schema.columns()" // fallback for older servers
]

for (const query of queries) {
try {
const response = await quest.query<QuestDB.InformationSchemaColumn>(query)

if (response?.type === QuestDB.Type.DQL) {
setColumns(response.data)
dispatch(actions.query.setColumns(response.data))
return
}
} catch {
// let's try another query
}
} catch (error) {
dispatchState({
view: View.error,
})
}

dispatchState({ view: View.error })
}


const copySchemasToClipboard = async () => {
if (!tables) return
let tablesWithError: string[] = []
Expand Down

0 comments on commit 382e22a

Please sign in to comment.