Skip to content
Open
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
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Set up Python
uses: actions/setup-python@v6
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Set up Python
uses: actions/setup-python@v6
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Run go vet
run: go vet ./...
Expand All @@ -94,6 +94,7 @@ jobs:
uses: dominikh/staticcheck-action@v1
with:
version: "latest"
install-go: false

vuln:
name: Vulnerability Check
Expand All @@ -104,7 +105,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
Expand All @@ -121,7 +122,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Build
run: go build ./...
Expand Down Expand Up @@ -168,7 +169,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Build pbench
run: go build -o ./bin/pbench
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.2"
go-version: "1.26.4"

- name: Build and package
run: make tar
Expand Down
19 changes: 19 additions & 0 deletions cmd/genddl/config_enhanced_ingestion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"mode": "enhanced_ingestion",
"scale_factor": "1",
"file_format": "parquet",
"compression_method": "uncompressed",
"workload": "tpcds",
"workload_definition": "tpc-ds",
"iceberg": true,
"partitioned": false,
"source_file_format": "CSV",
"source_catalog": "hive",
"target_catalog": "iceberg",
"source_schema": "tpcds_source",
"target_schema": "tpcds_target",
"s3_source_location": "s3a://test-bucket/source",
"s3_target_location": "s3a://test-bucket/target",
"engine": "presto",
"session_variables": {}
}
19 changes: 19 additions & 0 deletions cmd/genddl/config_enhanced_ingestion_textfile_partitioned.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"mode": "enhanced_ingestion",
"scale_factor": "100",
"file_format": "parquet",
"compression_method": "uncompressed",
"workload": "tpcds",
"workload_definition": "tpc-ds",
"iceberg": true,
"partitioned": true,
"source_file_format": "TEXTFILE",
"source_catalog": "hive",
"target_catalog": "iceberg",
"source_schema": "tpcds_source_textfile",
"target_schema": "tpcds_target_textfile",
"s3_source_location": "s3a://test-bucket/source-textfile",
"s3_target_location": "s3a://test-bucket/target-textfile",
"engine": "presto",
"session_variables": {}
}
45 changes: 45 additions & 0 deletions cmd/genddl/create_source_table.sql.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- /*gotype:pbench/cmd/genddl.Schema*/ -}}
{{- /* This template is used for ENHANCED_INGESTION mode - creates source tables */ -}}
{{- if .SourceSchema }}
{{- if .SourceCatalog }}
CREATE SCHEMA IF NOT EXISTS {{ .SourceCatalog }}.{{ .SourceSchema }}
WITH (
location = '{{ .S3SourceLocation }}/'
);

USE {{ .SourceCatalog }}.{{ .SourceSchema }};
{{- else }}
CREATE SCHEMA IF NOT EXISTS hive.{{ .SourceSchema }}
WITH (
location = '{{ .S3SourceLocation }}/'
);

USE hive.{{ .SourceSchema }};
{{- end }}

{{ range .Tables }}
CREATE TABLE IF NOT EXISTS {{ .Name }} (
{{- $first := true }}
{{- range .Columns }}
{{- if $first }}
{{- $first = false }}
{{- else }},
{{- end }}
{{- if eq $.SourceFileFormat "CSV" }}
{{ .Name }} varchar
{{- else }}
{{ .Name }} {{ .Type }}
{{- end }}
{{- end }})
WITH (
external_location = '{{ $.S3SourceLocation }}/{{ .Name }}/',
{{- if eq $.SourceFileFormat "CSV" }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source_file_format is unvalidated and case-sensitive. The source template treats anything != "CSV" as TEXTFILE, while insert generation (insert_table.sql.tmpl:24) treats anything != "TEXTFILE" as the CSV branch but only emits column expressions when the value is exactly "CSV". A lowercase "csv" therefore creates the source table as TEXTFILE and generates an INSERT with an empty SELECT column list (SELECT\nFROM ...) — invalid SQL, no error. Please validate source_file_format ∈ {CSV, TEXTFILE} in loadSchemas for enhanced mode.

format = 'CSV',
csv_separator = '|'
{{- else }}
format = 'TEXTFILE',
textfile_field_delim = '|'
{{- end }}
);
{{ end -}}
{{- end -}}
52 changes: 52 additions & 0 deletions cmd/genddl/create_target_table.sql.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{- /*gotype:pbench/cmd/genddl.Schema*/ -}}
{{- /* This template is used for ENHANCED_INGESTION mode - creates target tables */ -}}
{{- if .TargetSchema }}
{{- if .TargetCatalog }}
CREATE SCHEMA IF NOT EXISTS {{ .TargetCatalog }}.{{ .TargetSchema }}
WITH (
location = '{{ .S3TargetLocation }}/'
);

USE {{ .TargetCatalog }}.{{ .TargetSchema }};
{{- else }}
{{- if .Iceberg }}
CREATE SCHEMA IF NOT EXISTS iceberg.{{ .TargetSchema }}
WITH (
location = '{{ .S3TargetLocation }}/'
);

USE iceberg.{{ .TargetSchema }};
{{- else }}
CREATE SCHEMA IF NOT EXISTS hive.{{ .TargetSchema }}
WITH (
location = '{{ .S3TargetLocation }}/'
);

USE hive.{{ .TargetSchema }};
{{- end }}
{{- end }}

{{ range .Tables }}
CREATE TABLE IF NOT EXISTS {{ .Name }} (
{{- $first := true }}
{{- range .Columns }}
{{- if $first }}
{{- $first = false }}
{{- else -}}
,
{{- end }}
{{ .Name }} {{ .Type }}
{{- end }}
)
WITH (
format = 'PARQUET'
{{- if and $.Partitioned .Partitioned }}
{{- if $.Iceberg}}
, partitioning = array['{{ .LastColumn.Name }}']
{{- else }}
, partitioned_by = array['{{ .LastColumn.Name }}']
{{- end }}
{{- end }}
);
{{ end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion cmd/genddl/definition/tpc-ds/promotion.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"type": "DECIMAL(15,2)"
},
{
"name": "p_response_targe",
"name": "p_response_target",
"type": "INT"
},
{
Expand Down
Loading
Loading