Skip to content
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

Improve Parquet #1064

Merged
merged 13 commits into from
Nov 21, 2024
Merged

Improve Parquet #1064

merged 13 commits into from
Nov 21, 2024

Conversation

Tang8330
Copy link
Contributor

@Tang8330 Tang8330 commented Nov 21, 2024

Improving the way we write Parquet files, I've added comments to all the changes directly.

@@ -49,8 +49,7 @@ func (s *Store) IdentifierFor(topicConfig kafkalib.TopicConfig, table string) sq
func (s *Store) ObjectPrefix(tableData *optimization.TableData) string {
tableID := s.IdentifierFor(tableData.TopicConfig(), tableData.Name())
fqTableName := tableID.FullyQualifiedName()
yyyyMMDDFormat := tableData.LatestCDCTs.Format(ext.PostgresDateFormat)

yyyyMMDDFormat := fmt.Sprintf("date=%s", time.Now().Format(ext.PostgresDateFormat))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -89,29 +88,24 @@ func (s *Store) Merge(ctx context.Context, tableData *optimization.TableData) er
return fmt.Errorf("failed to create a local parquet file: %w", err)
}

pw, err := writer.NewJSONWriter(schema, fw, 4)
pw, err := writer.NewCSVWriter(schema, fw, 4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using CSV instead since JSON schema for Parquet is not widely supported

@Tang8330 Tang8330 marked this pull request as ready for review November 21, 2024 19:35
@Tang8330 Tang8330 requested a review from a team as a code owner November 21, 2024 19:35
"github.com/artie-labs/transfer/lib/typing/decimal"
"github.com/artie-labs/transfer/lib/typing/ext"
)

func ParseValue(colVal any, colKind columns.Column) (any, error) {
func ParseValue(colVal any, colKind typing.KindDetails) (any, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using colKind instead, we don't need the whole column

@Tang8330 Tang8330 merged commit 4344149 into master Nov 21, 2024
3 checks passed
@Tang8330 Tang8330 deleted the parquet-refactor branch November 21, 2024 19:48
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.

2 participants