Commit Graph

26751 Commits

Author SHA1 Message Date
David Dansby
dd80d98dc9 fix(import): address PR feedback for primary key validation
Update validation function to support name mapping during primary key
validation, allowing users to specify primary keys using either
original CSV column names or mapped target column names when using
the --map option. Ensure validation is properly skipped when schema
files are provided since --pk and --schema parameters are mutually
exclusive.

Update test expectations in import-create-tables.bats to match the
existing detailed error message format that includes available columns,
rather than changing the error messages to match the old test
expectations. Move new validation tests from import-tables.bats to
import-create-tables.bats as requested in code review.

The two failing tests "try to table import with nonexistent --pk arg"
and "try to table import with one valid and one nonexistent --pk arg"
now pass because our early validation catches these errors before
InferSchema, producing more helpful error messages that include
available columns. Updated the test expectations to match our
validation's error format instead of the old generic "column not found"
message.

Refs: #1083
2025-06-19 23:12:48 -07:00
David Dansby
d5a3c25678 feat(import): validate primary keys early
Add early validation to check if specified primary keys exist in the
import file's schema before processing rows. This prevents users from
waiting for large files to be processed only to discover that their
primary key column names are invalid.

Changes:
- Add validatePrimaryKeysAgainstSchema function to check primary key
  existence against file schema
- Integrate validation into newImportDataReader for create operations
- Provide helpful error messages listing available columns when
  primary keys are not found
- Add unit tests covering various validation scenarios
- Add BATS integration tests for CSV, PSV, and large file scenarios

The validation only runs for create operations when primary keys are
explicitly specified and no schema file is provided. This ensures
fast failure while maintaining backward compatibility.

Before: Users waited minutes for large files to process before seeing
"provided primary key not found" errors

After: Users get immediate feedback with helpful column suggestions

Refs: #1083
2025-06-12 23:47:34 -07:00
James Cor
ad234919dc [no-release-notes] add integrations tests for go-mysql-org (#9333) 2025-06-12 16:08:42 -07:00
angelamayxie
1f74d1c2e6 Merge pull request #9348 from dolthub/angelamayxie-8c4c7080
[auto-bump] [no-release-notes] dependency by angelamayxie
2025-06-12 14:54:12 -07:00
Nathan Gabrielson
74500e9579 Merge pull request #9344 from dolthub/nathan/commitTime
Nathan/commit time
2025-06-12 13:52:08 -07:00
angelamayxie
824b503812 [ga-bump-dep] Bump dependency in Dolt by angelamayxie 2025-06-12 18:33:08 +00:00
Dustin Brown
8b93716879 Merge pull request #9346 from dolthub/db/docker-env-vars
/docker/docker-entrypoint.sh: support env vars for creating a default database
2025-06-12 10:25:10 -07:00
coffeegoddd
4f4a067846 /docker/docker-entrypoint.sh: quick fix 2025-06-12 10:17:13 -07:00
coffeegoddd
859b4fd880 /docker/docker-entrypoint.sh: support env vars for creating a default database 2025-06-12 10:12:16 -07:00
Nathan Gabrielson
75cde3ea68 Unncessary variable declaration 2025-06-11 21:05:44 -07:00
Nathan Gabrielson
795dd4058f Expect is pain, expect is suffering 2025-06-11 21:02:48 -07:00
Nathan Gabrielson
8ca4bf3a32 Working tests + todo message for future improvmeent 2025-06-11 20:44:55 -07:00
Nathan Gabrielson
6cfa19f130 Some more changes, suffering with expect 2025-06-11 19:04:52 -07:00
James Cor
b695fbdad6 manual bump (#9338) 2025-06-11 15:12:40 -07:00
Nathan Gabrielson
40bd24a522 quick pass at commit time change 2025-06-11 15:04:38 -07:00
coffeegoddd
4c517bbd48 [ga-bump-release] Update Dolt version to 1.55.0 and release v1.55.0 v1.55.0 2025-06-11 21:35:35 +00:00
Nathan Gabrielson
c8a6b59d4a Merge pull request #9308 from dolthub/nathan/stashes
dolt_stash stored procedure
2025-06-11 14:03:55 -07:00
Aaron Son
6b13f0061b Merge pull request #9329 from dolthub/aaron/push-to-sql-server-during-gc-fixes
go: store/datas/database_common: store/nbs/store.go: Fix some issues when pushing to a dolt sql-server that is itself running GC.
2025-06-11 13:58:59 -07:00
Aaron Son
2d00d71b96 integration-tests/go-sql-server-driver/auto_gc_test.go: Remove some flakey asserts for now. 2025-06-11 12:15:27 -07:00
Aaron Son
de9915b817 go/store/nbs: Move sanity checks panics from file_table_reader into dynamic enabled asserts. 2025-06-11 11:34:20 -07:00
angelamayxie
f732029dba Merge pull request #9331 from dolthub/angelamayxie-c62c7e38
[auto-bump] [no-release-notes] dependency by angelamayxie
2025-06-10 17:03:27 -07:00
Nathan Gabrielson
a3bc2ba365 Better stash field name 2025-06-10 16:53:45 -07:00
NathanGabrielson
98b7a35a4a [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2025-06-10 23:48:30 +00:00
Nathan Gabrielson
a0c800690d Requested changes pt 2 2025-06-10 16:39:51 -07:00
Nathan Gabrielson
503c1379ec Some cleanup 2025-06-10 15:02:22 -07:00
Nathan Gabrielson
37deab0d41 Some more small fixes 2025-06-10 13:04:49 -07:00
reltuk
07a2e11e5c [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2025-06-10 18:43:53 +00:00
Aaron Son
5701a93cb2 go/store/nbs: Small PR cleanups. 2025-06-10 11:35:40 -07:00
NathanGabrielson
b0e5eee980 [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2025-06-10 18:08:40 +00:00
Nathan Gabrielson
f954cffa92 Requested changes 2025-06-10 10:59:52 -07:00
angelamayxie
123608731c [ga-bump-dep] Bump dependency in Dolt by angelamayxie 2025-06-10 17:42:07 +00:00
Taylor Bantle
93301be373 Merge pull request #9270 from dolthub/taylor/conflicts-preview-table
Add `dolt_preview_merge_conflicts` table function
2025-06-10 10:31:22 -07:00
Taylor Bantle
816935099c Merge remote-tracking branch 'origin/main' into taylor/conflicts-preview-table 2025-06-10 09:54:11 -07:00
angelamayxie
b3b7dcc158 Merge pull request #9328 from dolthub/angelamayxie-75f15bbd
[auto-bump] [no-release-notes] dependency by angelamayxie
2025-06-09 20:18:34 -07:00
Aaron Son
956f073dfd go: store/datas/database_common: store/nbs/store.go: Fix some issues when pushing to a dolt sql-server that is itself running GC.
A push to a remote works by uploading the missing content and then adding
references to it in the remote datastore. If the remote is running a GC during
the push, it is possible for the newly added data to be collected and no longer
be available when the references are added.

This should cause a transient failure which is safe is retry. There were a
couple bugs which could instead cause a panic. This makes some changes to
safeguard against those case.
2025-06-09 17:19:20 -07:00
angelamayxie
c91eec5491 [ga-bump-dep] Bump dependency in Dolt by angelamayxie 2025-06-09 23:51:56 +00:00
Jason Fulghum
15d3919e10 Merge pull request #9327 from dolthub/fulghum-c44b30ca
[auto-bump] [no-release-notes] dependency by fulghum
2025-06-09 16:23:07 -07:00
tbantle22
f1f9decdca [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2025-06-09 22:10:59 +00:00
fulghum
04dfc369b9 [ga-bump-dep] Bump dependency in Dolt by fulghum 2025-06-09 21:54:36 +00:00
Taylor Bantle
bbfbb8ffd1 Merge remote-tracking branch 'origin/main' into taylor/conflicts-preview-table 2025-06-09 14:54:31 -07:00
Taylor Bantle
bfcc421785 Merge pull request #9233 from dolthub/taylor/conflicts-preview
Add a `dolt_preview_merge_conflicts_summary` table function
2025-06-09 14:53:24 -07:00
Nathan Gabrielson
25d2e6eadb Fixed tests + cleanup 2025-06-09 14:16:49 -07:00
Taylor Bantle
43db156ed1 Merge branch 'taylor/conflicts-preview' into taylor/conflicts-preview-table 2025-06-09 12:57:21 -07:00
Taylor Bantle
e0225f4b0a Add comments 2025-06-09 12:57:14 -07:00
Taylor Bantle
3a5dcb3471 Update maven to 3.9.10 2025-06-09 12:20:33 -07:00
Taylor Bantle
98a0d7a31a Merge remote-tracking branch 'origin/main' into taylor/conflicts-preview 2025-06-09 12:08:06 -07:00
Nathan Gabrielson
01ca03baa6 Small fixes 2025-06-09 12:07:23 -07:00
Nathan Gabrielson
f2bb0baf71 Better tests & documentatioin & working stash reference 2025-06-09 12:07:23 -07:00
Nathan Gabrielson
406812d1e0 Many engine tests & a (mostly) working procedure 2025-06-09 12:07:23 -07:00
NathanGabrielson
c042c0c073 [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh 2025-06-09 12:07:23 -07:00