Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions amoro-ams/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<properties>
<swagger-ui.version>5.17.14</swagger-ui.version>
<lance-arrow-version>18.3.0</lance-arrow-version>
<git-commit-id-plugin.fail-on-no-git-dir>false</git-commit-id-plugin.fail-on-no-git-dir>
</properties>

Expand Down Expand Up @@ -409,6 +410,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-format-lance</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
Expand Down Expand Up @@ -618,6 +626,66 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>support-lance-format</id>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-bom</artifactId>
<version>${lance-arrow-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-format-lance</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-c-data</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-dataset</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-arrow-dependency-convergence</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>validate</phase>
<configuration>
<rules>
<DependencyConvergence></DependencyConvergence>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>support-all-formats</id>
<dependencies>
Expand All @@ -629,6 +697,10 @@
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-format-hudi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-format-lance</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@ public class CatalogBuilder {
ImmutableMap.of(
CATALOG_TYPE_HADOOP,
Sets.newHashSet(
TableFormat.ICEBERG, TableFormat.MIXED_ICEBERG, TableFormat.PAIMON, TableFormat.HUDI),
TableFormat.ICEBERG,
TableFormat.MIXED_ICEBERG,
TableFormat.PAIMON,
TableFormat.HUDI,
TableFormat.LANCE),
CATALOG_TYPE_FILESYSTEM,
Sets.newHashSet(
TableFormat.ICEBERG, TableFormat.MIXED_ICEBERG, TableFormat.PAIMON, TableFormat.HUDI),
TableFormat.ICEBERG,
TableFormat.MIXED_ICEBERG,
TableFormat.PAIMON,
TableFormat.HUDI,
TableFormat.LANCE),
CATALOG_TYPE_GLUE,
Sets.newHashSet(TableFormat.ICEBERG, TableFormat.MIXED_ICEBERG),
CATALOG_TYPE_REST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static org.apache.amoro.TableFormat.HUDI;
import static org.apache.amoro.TableFormat.ICEBERG;
import static org.apache.amoro.TableFormat.LANCE;
import static org.apache.amoro.TableFormat.MIXED_HIVE;
import static org.apache.amoro.TableFormat.MIXED_ICEBERG;
import static org.apache.amoro.TableFormat.PAIMON;
Expand Down Expand Up @@ -161,6 +162,18 @@ public class CatalogController {
CatalogDescriptor.of(CATALOG_TYPE_FILESYSTEM, STORAGE_CONFIGS_VALUE_TYPE_HADOOP, PAIMON));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_FILESYSTEM, STORAGE_CONFIGS_VALUE_TYPE_S3, PAIMON));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_FILESYSTEM, STORAGE_CONFIGS_VALUE_TYPE_S3, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_FILESYSTEM, STORAGE_CONFIGS_VALUE_TYPE_OSS, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_FILESYSTEM, STORAGE_CONFIGS_VALUE_TYPE_LOCAL, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_HADOOP, STORAGE_CONFIGS_VALUE_TYPE_LOCAL, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_HADOOP, STORAGE_CONFIGS_VALUE_TYPE_S3, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_HADOOP, STORAGE_CONFIGS_VALUE_TYPE_OSS, LANCE));
VALIDATE_CATALOGS.add(
CatalogDescriptor.of(CATALOG_TYPE_GLUE, STORAGE_CONFIGS_VALUE_TYPE_S3, ICEBERG));
VALIDATE_CATALOGS.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public AmoroTable<?> loadTable(String database, String table) {
TableFormat.MIXED_ICEBERG,
TableFormat.ICEBERG,
TableFormat.PAIMON,
TableFormat.HUDI)
TableFormat.HUDI,
TableFormat.LANCE)
.map(
formatCatalog -> {
try {
Expand All @@ -147,7 +148,8 @@ public List<TableIDWithFormat> listTables(String database) {
TableFormat.MIXED_ICEBERG,
TableFormat.ICEBERG,
TableFormat.PAIMON,
TableFormat.HUDI
TableFormat.HUDI,
TableFormat.LANCE
};

Map<String, TableFormat> tableNameToFormat = Maps.newHashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public final class TableFormat implements Serializable {
/** Open-source table formats */
public static final TableFormat ICEBERG = register("ICEBERG");

public static final TableFormat LANCE = register("LANCE");
public static final TableFormat MIXED_ICEBERG = register("MIXED_ICEBERG");
public static final TableFormat MIXED_HIVE = register("MIXED_HIVE");
public static final TableFormat PAIMON = register("PAIMON");
Expand Down
66 changes: 66 additions & 0 deletions amoro-format-lance/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-parent</artifactId>
<version>0.9-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>amoro-format-lance</artifactId>
<name>Amoro Project Lance Format</name>

<dependencies>
<dependency>
<groupId>org.apache.amoro</groupId>
<artifactId>amoro-common</artifactId>
</dependency>

<!-- Lance format Java API -->
<dependency>
<groupId>org.lance</groupId>
<artifactId>lance-core</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

2.0.0-rc.3 is ready, lance format seem to no ready for java api?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lance format seem to no ready for java api?

There's a bug fixed in 3.0.0. I've tested in my local env. Not ready to push yet. I will set this as draft

<version>2.0.0-beta.8</version>
</dependency>

<!-- Lance namespace interfaces and models -->
<dependency>
<groupId>org.lance</groupId>
<artifactId>lance-namespace-core</artifactId>
<version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.lance</groupId>
<artifactId>lance-namespace-apache-client</artifactId>
<version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.iceberg</groupId>
<artifactId>iceberg-aws</artifactId>
</dependency>
<dependency>
<groupId>org.apache.iceberg</groupId>
<artifactId>iceberg-aliyun</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.amoro.formats.lance;

import org.apache.amoro.FormatCatalog;
import org.apache.amoro.FormatCatalogFactory;
import org.apache.amoro.TableFormat;
import org.apache.amoro.table.TableMetaStore;

import java.util.HashMap;
import java.util.Map;

/** Lance format catalog factory. */
public class LanceCatalogFactory implements FormatCatalogFactory {

/** TableFormat instance for Lance. */
public static final TableFormat LANCE = TableFormat.register("LANCE");

@Override
public FormatCatalog create(
String catalogName,
String metastoreType,
Map<String, String> properties,
TableMetaStore metaStore) {
return new LanceDirectoryV1Catalog(catalogName, properties);
}

@Override
public TableFormat format() {
return LANCE;
}

@Override
public Map<String, String> convertCatalogProperties(
String catalogName, String metastoreType, Map<String, String> unifiedCatalogProperties) {
if (unifiedCatalogProperties == null) {
return null;
}

return new HashMap<>(unifiedCatalogProperties);
}
}
Loading