Skip to content

Commit

Permalink
source-snowflake: Fix out-of-range numeric value
Browse files Browse the repository at this point in the history
Our `TestBasicDatatypes` test included an out-of-range value for
a fixed-point numeric column which was previously rounded but now
Snowflake just rejects when we try to insert it. I've opted to fix
this by simply changing that value to something else that's within
the declared range -- it's not our business to validate Snowflake
numeric rounding behavior so long as we're processing whatever we
get back from them correctly.
  • Loading branch information
willdonnelly committed Nov 14, 2024
1 parent 87f3628 commit 41b6d58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source-snowflake/.snapshots/TestBasicDatatypes-main
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Collection "acmeCo/test/test_basicdatatypes_77528227": 3 Documents
# ================================
{"BDATA":"7loRpQ==","BIT":false,"DATA":"DCBA","FDATA":2.64,"ID":3,"X":0,"Y":0,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":0}}}
{"BDATA":"/w==","BIT":false,"DATA":" ","FDATA":0.00001,"ID":4,"X":-9999,"Y":100,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":1}}}
{"BDATA":"/w==","BIT":false,"DATA":" ","FDATA":0.00001,"ID":4,"X":-9999,"Y":-0.99,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":1}}}
{"BDATA":null,"BIT":null,"DATA":null,"FDATA":null,"ID":5,"X":null,"Y":null,"_meta":{"op":"c","source":{"schema":"PUBLIC","table":"test_BasicDatatypes_77528227","seq":2,"off":2}}}
# ================================
# Final State Checkpoint
Expand Down
2 changes: 1 addition & 1 deletion source-snowflake/capture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestBasicDatatypes(t *testing.T) {

tb.Insert(ctx, t, tableName, [][]any{
{3, "DCBA", []byte{0xEE, 0x5A, 0x11, 0xA5}, 2.64, false, 0, 0},
{4, " ", []byte{0xFF}, 0.00001, false, -9999, 99.999},
{4, " ", []byte{0xFF}, 0.00001, false, -9999, -0.99},
{5, nil, nil, nil, nil, nil, nil},
})
t.Run("main", func(t *testing.T) { verifiedCapture(ctx, t, cs) })
Expand Down

0 comments on commit 41b6d58

Please sign in to comment.