@firebaseextensions/firestore-bigquery-change-tracker 1.1.30 → 1.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bigquery/partitioning.js +23 -19
- package/package.json +1 -1
|
@@ -63,10 +63,14 @@ class Partitioning {
|
|
|
63
63
|
/* No custom config has been set, use partition value option only */
|
|
64
64
|
if (hasNoCustomOptions)
|
|
65
65
|
return true;
|
|
66
|
-
/* check if all
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
/* check if all valid combinations have been provided*/
|
|
67
|
+
const hasOnlyTimestamp = timePartitioningField === "timestamp" &&
|
|
68
|
+
!timePartitioningFieldType &&
|
|
69
|
+
!timePartitioningFirestoreField;
|
|
70
|
+
return (hasOnlyTimestamp ||
|
|
71
|
+
(!!timePartitioningField &&
|
|
72
|
+
!!timePartitioningFieldType &&
|
|
73
|
+
!!timePartitioningFirestoreField));
|
|
70
74
|
}
|
|
71
75
|
hasValidTimePartitionOption() {
|
|
72
76
|
const { timePartitioning } = this.config;
|
|
@@ -180,53 +184,53 @@ class Partitioning {
|
|
|
180
184
|
async addPartitioningToSchema(fields = []) {
|
|
181
185
|
/** check if class has valid table reference */
|
|
182
186
|
if (!this.hasValidTableReference())
|
|
183
|
-
return
|
|
187
|
+
return;
|
|
184
188
|
/** return if table is already partitioned **/
|
|
185
189
|
if (await this.isTablePartitioned())
|
|
186
|
-
return
|
|
190
|
+
return;
|
|
187
191
|
/** return if an invalid partition type has been requested**/
|
|
188
192
|
if (!this.hasValidTimePartitionType())
|
|
189
|
-
return
|
|
193
|
+
return;
|
|
190
194
|
/** Return if invalid partitioning and field type combination */
|
|
191
195
|
if (this.hasHourAndDatePartitionConfig())
|
|
192
|
-
return
|
|
196
|
+
return;
|
|
193
197
|
/** return if an invalid partition type has been requested**/
|
|
194
198
|
if (!this.hasValidCustomPartitionConfig())
|
|
195
|
-
return
|
|
199
|
+
return;
|
|
196
200
|
/** return if an invalid partition type has been requested**/
|
|
197
201
|
if (!this.hasValidCustomPartitionConfig())
|
|
198
|
-
return
|
|
202
|
+
return;
|
|
199
203
|
/** update fields with new schema option ** */
|
|
200
204
|
if (!this.hasValidTimePartitionOption())
|
|
201
|
-
return
|
|
205
|
+
return;
|
|
202
206
|
/* Check if partition field has been provided */
|
|
203
207
|
if (!this.config.timePartitioningField)
|
|
204
|
-
return
|
|
208
|
+
return;
|
|
205
209
|
// if (await !this.hasExistingSchema) return Promise.resolve();
|
|
206
210
|
// Field already exists on schema, skip
|
|
207
211
|
if (this.customFieldExists(fields))
|
|
208
|
-
return
|
|
212
|
+
return;
|
|
209
213
|
fields.push((0, schema_1.getNewPartitionField)(this.config));
|
|
210
214
|
/** log successful addition of partition column */
|
|
211
215
|
logs.addPartitionFieldColumn(this.table.id, this.config.timePartitioningField);
|
|
212
|
-
return
|
|
216
|
+
return;
|
|
213
217
|
}
|
|
214
218
|
async updateTableMetadata(options) {
|
|
215
219
|
/** return if table is already partitioned **/
|
|
216
220
|
if (await this.isTablePartitioned())
|
|
217
|
-
return
|
|
221
|
+
return;
|
|
218
222
|
/** return if an invalid partition type has been requested**/
|
|
219
223
|
if (!this.hasValidTimePartitionType())
|
|
220
|
-
return
|
|
224
|
+
return;
|
|
221
225
|
/** update fields with new schema option ** */
|
|
222
226
|
if (!this.hasValidTimePartitionOption())
|
|
223
|
-
return
|
|
227
|
+
return;
|
|
224
228
|
/** Return if invalid partitioning and field type combination */
|
|
225
229
|
if (this.hasHourAndDatePartitionConfig())
|
|
226
|
-
return
|
|
230
|
+
return;
|
|
227
231
|
/** return if an invalid partition type has been requested**/
|
|
228
232
|
if (!this.hasValidCustomPartitionConfig())
|
|
229
|
-
return
|
|
233
|
+
return;
|
|
230
234
|
// if (await !this.hasExistingSchema) return Promise.resolve();
|
|
231
235
|
if (this.config.timePartitioning) {
|
|
232
236
|
options.timePartitioning = { type: this.config.timePartitioning };
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "github.com/firebase/extensions.git",
|
|
6
6
|
"directory": "firestore-bigquery-export/firestore-bigquery-change-tracker"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.1.
|
|
8
|
+
"version": "1.1.31",
|
|
9
9
|
"description": "Core change-tracker library for Cloud Firestore Collection BigQuery Exports",
|
|
10
10
|
"main": "./lib/index.js",
|
|
11
11
|
"scripts": {
|