yuqi1129 opened a new issue, #8374:
URL: https://github.com/apache/gravitino/issues/8374

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   py4j.protocol.Py4JJavaError: An error occurred while calling o83.csv.
   : java.lang.NoClassDefFoundError: 
org/apache/hadoop/thirdparty/com/google/common/base/Preconditions
        at 
org.apache.hadoop.fs.aliyun.oss.AliyunOSSUtils.longOption(AliyunOSSUtils.java:221)
        at 
org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:343)
        at 
org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3303)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:124)
        at 
org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3352)
        at org.apache.hadoop.fs.FileSystem$Cache.getUnique(FileSystem.java:3326)
        at org.apache.hadoop.fs.FileSystem.newInstance(FileSystem.java:532)
        at 
org.apache.gravitino.oss.fs.OSSFileSystemProvider.getFileSystem(OSSFileSystemProvider.java:68)
        at 
org.apache.gravitino.filesystem.hadoop.BaseGVFSOperations.getActualFileSystemByPath(BaseGVFSOperations.java:667)
        at 
org.apache.gravitino.filesystem.hadoop.BaseGVFSOperations.lambda$getActualFileSystemByLocationName$5(BaseGVFSOperations.java:612)
        at 
org.apache.gravitino.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406)
        at 
java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
        at 
org.apache.gravitino.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404)
        at 
org.apache.gravitino.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387)
        at 
org.apache.gravitino.shaded.com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
        at 
org.apache.gravitino.shaded.com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62)
        at 
org.apache.gravitino.filesystem.hadoop.BaseGVFSOperations.getActualFileSystemByLocationName(BaseGVFSOperations.java:590)
        at 
org.apache.gravitino.filesystem.hadoop.BaseGVFSOperations.getActualFileSystem(BaseGVFSOperations.java:528)
        at org.apache.gravitino.filesystem.hadoop.Defaul
   
   ### Error message and/or stacktrace
   
   see above.
   
   ### How to reproduce
   
   JDK8
   
   test code
   ```
   import logging
   logging.basicConfig(level=logging.INFO)
   
   from gravitino import NameIdentifier, GravitinoClient, Catalog, Fileset, 
GravitinoAdminClient
   
   gravitino_url = "http://localhost:8090";
   metalake_name = "test"
   
   catalog_name = "oss_catalog"
   schema_name = "schema"
   fileset_name = "fileset01"
   
   fileset_ident = NameIdentifier.of(schema_name, fileset_name)
   
   gravitino_admin_client = GravitinoAdminClient(uri=gravitino_url)
   gravitino_client = GravitinoClient(uri=gravitino_url, 
metalake_name=metalake_name)
   from pyspark.sql import SparkSession
   import os
   
   os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars 
/Users/yuqi/project/graviton/bundles/aliyun/build/libs/gravitino-aliyun-1.0.0-SNAPSHOT.jar,/Users/yuqi/project/graviton/clients/filesystem-hadoop3-runtime/build/libs/gravitino-filesystem-hadoop3-runtime-1.0.0-SNAPSHOT.jar,/Users/yuqi/Downloads/hadoop-jars/aliyun-sdk-oss-3.13.0.jar,/Users/yuqi/Downloads/hadoop-jars/hadoop-aliyun-3.3.4.jar,/Users/yuqi/Downloads/hadoop-jars/jdom2-2.0.6.jar
 --conf 
\"spark.driver.extraJavaOptions=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005\"
 --conf 
\"spark.executor.extraJavaOptions=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006\"
 --master local[1] pyspark-shell"
   
   spark = SparkSession.builder \
       .appName("s3_fielset_test") \
       .config("spark.hadoop.fs.AbstractFileSystem.gvfs.impl", 
"org.apache.gravitino.filesystem.hadoop.Gvfs") \
       .config("spark.hadoop.fs.gvfs.impl", 
"org.apache.gravitino.filesystem.hadoop.GravitinoVirtualFileSystem") \
       .config("spark.hadoop.fs.gravitino.server.uri", "http://localhost:8090";) 
\
       .config("spark.hadoop.fs.gravitino.client.metalake", "test") \
       .config("spark.hadoop.oss-access-key-id", "xxx") \
       .config("spark.hadoop.oss-secret-access-key", "xxx") \
       .config("spark.hadoop.oss-endpoint", 
"https://oss-cn-shanghai.aliyuncs.com";) \
       .config("spark.driver.memory", "2g") \
       .config("spark.driver.port", "2048") \
       .getOrCreate()
   
   data = [("Alice", 25), ("Bob", 30), ("Cathy", 45)]
   columns = ["Name", "Age"]
   spark_df = spark.createDataFrame(data, schema=columns)
   gvfs_path = 
f"gvfs://fileset/{catalog_name}/{schema_name}/{fileset_name}/people"
   
   spark_df.coalesce(1).write \
       .mode("overwrite") \
       .option("header", "true") \
       .csv(gvfs_path)  
   ```
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to