Skip to content

Commit 054b908

Browse files
authored
chore(diff): Ignore backticks (#11028)
Follow-up for cloudquery/plugin-sdk#908
1 parent a443d03 commit 054b908

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

scripts/table_diff/changes/changes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func parseColumnChange(line string) (name string, dataType string, columnType co
6868
columnType |= columnTypeIncremental
6969
}
7070
cleanName := strings.Split(result["name"], " (")[0]
71-
return cleanName, result["dataType"], columnType
71+
return cleanName, strings.Trim(result["dataType"], "`"), columnType
7272
}
7373

7474
func parsePKChange(line string) (names []string) {

scripts/table_diff/changes/changes_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ func Test_getChanges(t *testing.T) {
366366
diffDataFile: "testdata/pr_10831_diff.txt",
367367
wantChanges: []change{},
368368
},
369+
{
370+
name: "Should handle CQTypes -> Apache Arrow column changes with backticks, too",
371+
diffDataFile: "testdata/pr_10831_diff_backtick.txt",
372+
wantChanges: []change{},
373+
},
369374
{
370375
name: "Should handle CQTypes -> Apache Arrow column changes with lists, too",
371376
diffDataFile: "testdata/pr_10797_diff.txt",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/website/tables/hackernews/hackernews_items.md b/website/tables/hackernews/hackernews_items.md
2+
index 27915dd5235b..2cbb11f5eb4c 100644
3+
--- a/website/tables/hackernews/hackernews_items.md
4+
+++ b/website/tables/hackernews/hackernews_items.md
5+
@@ -11,21 +11,21 @@ It supports incremental syncs based on the **id** column.
6+
7+
| Name | Type |
8+
| ------------- | ------------- |
9+
-|_cq_source_name|String|
10+
-|_cq_sync_time|Timestamp|
11+
-|_cq_id|UUID|
12+
-|_cq_parent_id|UUID|
13+
-|id (PK) (Incremental Key)|Int|
14+
-|deleted|Bool|
15+
-|type|String|
16+
-|by|String|
17+
-|time|Timestamp|
18+
-|text|String|
19+
-|dead|Bool|
20+
-|parent|Int|
21+
-|kids|IntArray|
22+
-|url|String|
23+
-|score|Int|
24+
-|title|String|
25+
-|parts|IntArray|
26+
-|descendants|Int|
27+
\ No newline at end of file
28+
+|_cq_source_name|`utf8`|
29+
+|_cq_sync_time|`timestamp[us, tz=UTC]`|
30+
+|_cq_id|`uuid`|
31+
+|_cq_parent_id|`uuid`|
32+
+|id (PK) (Incremental Key)|`int64`|
33+
+|deleted|`bool`|
34+
+|type|`utf8`|
35+
+|by|`utf8`|
36+
+|time|`timestamp[us, tz=UTC]`|
37+
+|text|`utf8`|
38+
+|dead|`bool`|
39+
+|parent|`int64`|
40+
+|kids|`list<item: int64, nullable>`|
41+
+|url|`utf8`|
42+
+|score|`int64`|
43+
+|title|`utf8`|
44+
+|parts|`list<item: int64, nullable>`|
45+
+|descendants|`int64`|
46+
\ No newline at end of file

0 commit comments

Comments
 (0)