Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/browser-tests/questdb
Submodule questdb updated 89 files
+1 −0 .github/workflows/rebuild_native_libs.yml
+1 −0 .github/workflows/rebuild_rust.yml
+3 −0 .idea/codeStyles/Project.xml
+12 −7 artifacts/release/README.md
+1 −1 benchmarks/pom.xml
+17 −2 ci/docker-release-pipeline.yml
+15 −37 ci/github-release-pipeline.yml
+1 −1 compat/pom.xml
+39 −6 core/Dockerfile
+6 −2 core/docker-entrypoint.sh
+2 −2 core/pom.xml
+ core/src/main/bin/darwin-aarch64/libjemalloc.dylib
+ core/src/main/bin/darwin-x86-64/libjemalloc.dylib
+8 −1 core/src/main/c/freebsd/files.c
+76 −20 core/src/main/java/io/questdb/PropServerConfiguration.java
+1 −5 core/src/main/java/io/questdb/ServerMain.java
+16 −0 core/src/main/java/io/questdb/cairo/ColumnType.java
+18 −4 core/src/main/java/io/questdb/cairo/DefaultCairoConfiguration.java
+45 −32 core/src/main/java/io/questdb/cairo/O3OpenColumnJob.java
+7 −5 core/src/main/java/io/questdb/cairo/TableWriter.java
+15 −0 core/src/main/java/io/questdb/cairo/sql/AtomicBooleanCircuitBreaker.java
+18 −1 core/src/main/java/io/questdb/cairo/sql/NetworkSqlExecutionCircuitBreaker.java
+22 −4 core/src/main/java/io/questdb/cairo/sql/SqlExecutionCircuitBreaker.java
+154 −0 core/src/main/java/io/questdb/cairo/sql/SqlExecutionCircuitBreakerWrapper.java
+31 −20 core/src/main/java/io/questdb/cairo/sql/async/PageFrameReduceJob.java
+9 −13 core/src/main/java/io/questdb/cairo/sql/async/PageFrameSequence.java
+2 −3 core/src/main/java/io/questdb/cairo/wal/ApplyWal2TableJob.java
+11 −11 core/src/main/java/io/questdb/cairo/wal/OperationExecutor.java
+1 −0 core/src/main/java/io/questdb/cutlass/http/HttpConstants.java
+9 −2 core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessor.java
+42 −4 core/src/main/java/io/questdb/cutlass/http/processors/JsonQueryProcessorState.java
+10 −1 core/src/main/java/io/questdb/griffin/SqlCodeGenerator.java
+6 −9 core/src/main/java/io/questdb/griffin/SqlCompilerImpl.java
+3 −6 core/src/main/java/io/questdb/griffin/SqlParser.java
+12 −0 core/src/main/java/io/questdb/griffin/SqlUtil.java
+46 −14 core/src/main/java/io/questdb/griffin/engine/QueryProgress.java
+11 −4 core/src/main/java/io/questdb/griffin/engine/functions/rnd/LongSequenceFunctionFactory.java
+43 −21 core/src/main/java/io/questdb/griffin/engine/groupby/FillRangeRecordCursorFactory.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByCharSink.java
+1 −15 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByIntHashSet.java
+1 −15 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByLong128HashSet.java
+1 −15 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByLong256HashSet.java
+1 −15 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByLongHashSet.java
+1 −1 core/src/main/java/io/questdb/griffin/engine/groupby/GroupByUtf8Sink.java
+58 −26 core/src/main/java/io/questdb/griffin/engine/groupby/TimestampSamplerFactory.java
+36 −6 core/src/main/java/io/questdb/griffin/engine/table/AsyncGroupByAtom.java
+13 −3 core/src/main/java/io/questdb/griffin/engine/table/AsyncGroupByNotKeyedAtom.java
+13 −3 core/src/main/java/io/questdb/griffin/engine/table/AsyncGroupByNotKeyedRecordCursorFactory.java
+18 −4 core/src/main/java/io/questdb/griffin/engine/table/AsyncGroupByRecordCursorFactory.java
+2 −5 core/src/main/java/io/questdb/mp/WorkerPoolUtils.java
+1 −1 core/src/main/java/io/questdb/std/Files.java
+1 −3 core/src/main/java/io/questdb/std/MemoryTag.java
+ core/src/main/resources/io/questdb/bin/darwin-aarch64/libquestdb.dylib
+ core/src/main/resources/io/questdb/bin/darwin-aarch64/libquestdbr.dylib
+ core/src/main/resources/io/questdb/bin/darwin-x86-64/libquestdb.dylib
+ core/src/main/resources/io/questdb/bin/darwin-x86-64/libquestdbr.dylib
+ core/src/main/resources/io/questdb/bin/windows-x86-64/libquestdb.dll
+ core/src/main/resources/io/questdb/bin/windows-x86-64/questdbr.dll
+5 −1 core/src/test/java/io/questdb/test/ConcurrentTcpSenderBootstrapTest.java
+3 −3 core/src/test/java/io/questdb/test/EmbeddedApiTest.java
+36 −7 core/src/test/java/io/questdb/test/PropServerConfigurationTest.java
+2 −2 core/src/test/java/io/questdb/test/ServerMainTest.java
+3 −28 core/src/test/java/io/questdb/test/StaticOverrides.java
+1 −1 core/src/test/java/io/questdb/test/cairo/Overrides.java
+223 −23 core/src/test/java/io/questdb/test/cutlass/http/IODispatcherTest.java
+1 −1 core/src/test/java/io/questdb/test/cutlass/http/MetricsIODispatcherTest.java
+45 −0 core/src/test/java/io/questdb/test/cutlass/pgwire/IntervalPGTest.java
+72 −70 core/src/test/java/io/questdb/test/cutlass/text/TextLoaderTest.java
+1 −1 core/src/test/java/io/questdb/test/griffin/AlterTableAddColumnTest.java
+2 −1 core/src/test/java/io/questdb/test/griffin/AlterTableChangeColumnTypeTest.java
+21 −23 core/src/test/java/io/questdb/test/griffin/CheckpointTest.java
+5 −9 core/src/test/java/io/questdb/test/griffin/OrderByTimeoutTest.java
+15 −1 core/src/test/java/io/questdb/test/griffin/SecurityTest.java
+29 −0 core/src/test/java/io/questdb/test/griffin/SqlCompilerImplTest.java
+5 −5 core/src/test/java/io/questdb/test/griffin/UpdateTest.java
+15 −16 core/src/test/java/io/questdb/test/griffin/engine/QueryExecutionTimeoutTest.java
+55 −2 core/src/test/java/io/questdb/test/griffin/engine/groupby/SampleByTest.java
+45 −0 core/src/test/java/io/questdb/test/griffin/engine/groupby/TimestampSamplerFactoryTest.java
+85 −48 core/src/test/java/io/questdb/test/griffin/engine/table/AsyncFilteredRecordCursorFactoryTest.java
+28 −20 core/src/test/java/io/questdb/test/griffin/wal/DedupInsertFuzzTest.java
+4 −2 core/src/test/java/io/questdb/test/mp/ConcurrentQueueFuzzTest.java
+16 −0 core/src/test/java/io/questdb/test/mp/TestWorkerPool.java
+42 −0 core/src/test/java/io/questdb/test/sqllogictest/SqlTest.java
+1 −2 core/src/test/java/io/questdb/test/tools/TestUtils.java
+48 −0 core/src/test/resources/sqllogictest/test/dedup/dedup_size.test
+11 −0 core/src/test/resources/sqllogictest/test/sql/functions.test
+1 −1 examples/pom.xml
+1 −1 pom.xml
+1 −1 utils/pom.xml
6 changes: 6 additions & 0 deletions packages/web-console/src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ const BASE = process.env.NODE_ENV === "production" ? "fara" : "alurin"

export const API = `https://${BASE}.questdb.io`

// QuestDB API version
// to be included in all requests
// so server-side can construct a reply
// the console will understand
export const API_VERSION = "2";

export const BUTTON_ICON_SIZE = "26px"
15 changes: 15 additions & 0 deletions packages/web-console/src/scenes/Editor/Monaco/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,21 @@ const MonacoEditor = () => {
eventBus.publish(EventType.MSG_QUERY_SCHEMA)
}

if (result.type === QuestDB.Type.NOTICE) {
dispatch(
actions.query.addNotification({
content: (
<Text color="foreground" ellipsis title={result.query}>
{result.notice}
{result.query !== undefined && result.query !== '' && `: ${result.query}`}
</Text>
),
type: NotificationType.NOTICE,
}),
)
eventBus.publish(EventType.MSG_QUERY_SCHEMA)
}

if (result.type === QuestDB.Type.DQL) {
setLastExecutedQuery(request.query)
dispatch(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2022 QuestDB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/

import React from "react"
import styled from "styled-components"
import { Wrapper, Content, SideContent } from "../styles"
import { Timestamp } from "../Timestamp"
import { NotificationShape } from "../../../../types"
import { InfoOutline } from "@styled-icons/evaicons-outline"
import { color } from "../../../../utils"

const InfoOutlineIcon = styled(InfoOutline)`
color: ${color("yellow")};
flex-shrink: 0;
`

export const NoticeNotification = (props: NotificationShape) => {
const { createdAt, content, sideContent, isMinimized } = props
return (
<Wrapper isMinimized={isMinimized}>
<Timestamp createdAt={createdAt} />
<InfoOutlineIcon size="18px" />
<Content>{content}</Content>
<SideContent>{sideContent}</SideContent>
</Wrapper>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ import { NotificationShape, NotificationType } from "../../../types"
import { SuccessNotification } from "./SuccessNotification"
import { ErrorNotification } from "./ErrorNotification"
import { InfoNotification } from "./InfoNotification"
import {NoticeNotification} from "./NoticeNotification";

const Notification = (props: NotificationShape) => {
const { type } = props
return type === NotificationType.SUCCESS ? (
<SuccessNotification {...props} />
) : type === NotificationType.ERROR ? (
<ErrorNotification {...props} />
) : type == NotificationType.NOTICE ? (
<NoticeNotification {...props} />
) : (
<InfoNotification {...props} />
)
Expand Down
1 change: 1 addition & 0 deletions packages/web-console/src/store/Query/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export enum NotificationType {
ERROR = "error",
INFO = "info",
SUCCESS = "success",
NOTICE = "notice",
}

export type NotificationShape = Readonly<{
Expand Down
31 changes: 29 additions & 2 deletions packages/web-console/src/utils/questdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { eventBus } from "../modules/EventBus"
import { EventType } from "../modules/EventBus/types"
import { AuthPayload } from "../modules/OAuth2/types"
import { StoreKey } from "./localStorage/types"
import {API_VERSION} from "../consts";

type ColumnDefinition = Readonly<{ name: string; type: string }>

Expand All @@ -38,6 +39,7 @@ export enum Type {
DML = "dml",
DQL = "dql",
ERROR = "error",
NOTICE = "notice",
}

export type Timings = {
Expand All @@ -58,6 +60,7 @@ type RawDqlResult = {
dataset: DatasetType[]
ddl: undefined
dml: undefined
notice: undefined
error: undefined
query: string
timings: Timings
Expand All @@ -82,6 +85,15 @@ type RawErrorResult = {
query: string
}

type RawNoticeResult = {
ddl: undefined
dml: undefined
error: undefined
notice: "<notice message>"
position: undefined
query: string
}

type DdlResult = {
query: string
type: Type.DDL
Expand All @@ -92,18 +104,23 @@ type DmlResult = {
type: Type.DML
}

type RawResult = RawDqlResult | RawDmlResult | RawDdlResult | RawErrorResult
type RawResult = RawDqlResult | RawDmlResult | RawDdlResult | RawErrorResult | RawNoticeResult

export type ErrorResult = RawErrorResult & {
type: Type.ERROR
status: number
}

export type NoticeResult = RawNoticeResult & {
type: Type.NOTICE
}

export type QueryRawResult =
| (Omit<RawDqlResult, "ddl" | "dml"> & { type: Type.DQL })
| DmlResult
| DdlResult
| ErrorResult
| NoticeResult

export type QueryResult<T extends Record<string, any>> =
| {
Expand All @@ -117,6 +134,7 @@ export type QueryResult<T extends Record<string, any>> =
| ErrorResult
| DmlResult
| DdlResult
| NoticeResult

export type PartitionBy = "HOUR" | "DAY" | "WEEK" | "MONTH" | "YEAR" | "NONE"

Expand Down Expand Up @@ -401,6 +419,7 @@ export class Client {
src: "con",
query,
timings: true,
version: API_VERSION,
...options,
}

Expand Down Expand Up @@ -503,6 +522,13 @@ export class Client {
})
}

if (data.notice) {
return {
...data,
type: Type.NOTICE,
}
}

return {
...data,
timings: {
Expand Down Expand Up @@ -594,6 +620,7 @@ export class Client {
`chk?${Client.encodeParams({
f: "json",
j: name,
version: API_VERSION,
})}`,
{ headers: this.commonHeaders },
)
Expand Down Expand Up @@ -667,7 +694,7 @@ export class Client {
async exportQueryToCsv(query: string) {
try {
const response: Response = await fetch(
`exp?${Client.encodeParams({ query })}`,
`exp?${Client.encodeParams({ query, version: API_VERSION })}`,
{ headers: this.commonHeaders },
)
const blob = await response.blob()
Expand Down