Skip to content

Commit 913a469

Browse files
committed
[Python] Introduce incremental-between read by timestamp
1 parent 05e127e commit 913a469

24 files changed

Lines changed: 762 additions & 466 deletions

paimon-python/pypaimon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from pypaimon.filesystem.pvfs import PaimonVirtualFileSystem
1918
from pypaimon.catalog.catalog_factory import CatalogFactory
19+
from pypaimon.filesystem.pvfs import PaimonVirtualFileSystem
2020
from pypaimon.schema.schema import Schema
2121

2222
__version__ = "1.4.dev"

paimon-python/pypaimon/common/core_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ def __str__(self):
4545
FILE_BLOCK_SIZE = "file.block-size"
4646
# Scan options
4747
SCAN_FALLBACK_BRANCH = "scan.fallback-branch"
48+
INCREMENTAL_BETWEEN_TIMESTAMP = "incremental-between-timestamp"
4849
# Commit options
4950
COMMIT_USER_PREFIX = "commit.user-prefix"

paimon-python/pypaimon/filesystem/pvfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from fsspec.implementations.local import LocalFileSystem
3030
from readerwriterlock import rwlock
3131

32-
from pypaimon.api.api_response import GetTableTokenResponse, GetTableResponse
32+
from pypaimon.api.api_response import GetTableResponse, GetTableTokenResponse
3333
from pypaimon.api.client import AlreadyExistsException, NoSuchResourceException
3434
from pypaimon.api.rest_api import RESTApi
3535
from pypaimon.common.config import CatalogOptions, OssOptions, PVFSOptions

paimon-python/pypaimon/manifest/manifest_file_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
################################################################################
18-
import fastavro
1918
from io import BytesIO
2019
from typing import List
2120

21+
import fastavro
22+
2223
from pypaimon.manifest.schema.data_file_meta import DataFileMeta
2324
from pypaimon.manifest.schema.manifest_entry import (MANIFEST_ENTRY_SCHEMA,
2425
ManifestEntry)

paimon-python/pypaimon/manifest/manifest_list_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def read_all(self, snapshot: Snapshot) -> List[ManifestFileMeta]:
4747
manifest_files.extend(delta_manifests)
4848
return manifest_files
4949

50+
def read_delta(self, snapshot: Snapshot) -> List[ManifestFileMeta]:
51+
return self.read(snapshot.delta_manifest_list)
52+
5053
def read(self, manifest_list_name: str) -> List[ManifestFileMeta]:
5154
manifest_files = []
5255

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
"""
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
"""
18+
from pypaimon.read.plan import Plan
19+
from pypaimon.read.scanner.starting_scanner import StartingScanner
20+
21+
22+
class EmptyStartingScanner(StartingScanner):
23+
24+
def scan(self) -> Plan:
25+
return Plan([])

0 commit comments

Comments
 (0)