-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Core: Introduce interface for column files #16285
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.iceberg; | ||
|
|
||
| import java.util.List; | ||
| import org.apache.iceberg.types.Types; | ||
|
|
||
| /** Information about a column file. */ | ||
| interface ColumnFileInfo { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe simply |
||
| Types.NestedField FIELD_IDS = | ||
| Types.NestedField.required( | ||
| 159, | ||
| "field_ids", | ||
| Types.ListType.ofRequired(160, Types.IntegerType.get()), | ||
| "Field IDs this column file contains"); | ||
| Types.NestedField LOCATION = | ||
| Types.NestedField.required( | ||
| 161, "location", Types.StringType.get(), "Location of the column file"); | ||
| Types.NestedField FILE_SIZE_IN_BYTES = | ||
| Types.NestedField.required( | ||
| 162, "file_size_in_bytes", Types.LongType.get(), "Total column file size in bytes"); | ||
|
Comment on lines
+26
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we wait for finalizing the spec? I will create a spec PR when it has been finalized and then we can continue this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, the conversation on the exact layout could go in parallel. I just sketched in this PR how it would look like in terms of code. Hopefully we can finalize this in the next sync. |
||
| Types.NestedField SEQUENCE_NUMBER = | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The usage for this was meant to be for equality deletes. Since we agree not to support it together with column updates, I think we can drop seq_nums from this schema.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can use this for las-updated-sequence-number for the rows that we update:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took another look: I think we need this field to provide
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I have iterated on this a couple of times. I think there is a way how to avoid storing sequence_number here. Since this gets complicated, I added a section to the design doc to explain. |
||
| Types.NestedField.optional( | ||
| 163, "sequence_number", Types.LongType.get(), "Sequence number of the column file"); | ||
|
|
||
| static Types.StructType schema() { | ||
| return Types.StructType.of(FIELD_IDS, LOCATION, FILE_SIZE_IN_BYTES, SEQUENCE_NUMBER); | ||
| } | ||
|
|
||
| /** Returns the field IDs contained in this column file. */ | ||
| List<Integer> fieldIds(); | ||
|
|
||
| /** Returns the location of the column file. */ | ||
| String location(); | ||
|
|
||
| /** Returns the total size of the column file in bytes. */ | ||
| long fileSizeInBytes(); | ||
|
|
||
| /** Returns the sequence number of the column file, or null if not set. */ | ||
| Long sequenceNumber(); | ||
|
|
||
| /** Copies this column file info. */ | ||
| ColumnFileInfo copy(); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we always assume the column file uses the same file_format as base file? If not, should we explicitly add
file_formathere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also crossed my mind, but ATM I don't think we want to add that extra complexity and it is somewhat speculative now. We could introduce that later if there is a clear need.