Skip to content

refactor(firestore-bigquery-changetracker): improve partitioning code #2445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

cabljac
Copy link
Contributor

@cabljac cabljac commented Jun 10, 2025

No description provided.

const IngestionTimePartitioningSchema = BaseConfigSchema.extend({
timePartitioning: z.enum(["HOUR", "DAY", "MONTH", "YEAR"]),
timePartitioningColumn: z.undefined(),
timePartitioningFieldType: z.undefined(),
Copy link
Contributor Author

@cabljac cabljac Jun 12, 2025

Choose a reason for hiding this comment

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

I think we should change this to timePartitioningColumnType to continue semantic difference between firestore and BQ

We should consistently call BQ fields/columns "columns"

and Firestore fields we will call "fields"

import { z } from "zod";

/**
* This is the shared base for all configuration variants. It includes all
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a public schema/type for the main exported change tracker class

FieldInternalSchema,
]);

const InternalPartitioningSchema = z.preprocess((data) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds the partitioningType onto the config...

I dont know whether we actually need the rest of the config, perhaps it's better just to extract a smaller config. Need to check what we actually use here from config

schema?: object
import { BigQuery, TableField } from "@google-cloud/bigquery";

const BaseSchema = z.object({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs to be fixed

@cabljac cabljac force-pushed the @invertase/fix-partitioning branch from bcc3fe9 to 06ba7e2 Compare June 12, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant