questsul commented on issue #1106:
URL:
https://github.com/apache/iceberg-python/issues/1106#issuecomment-2312078437
How to reproduce:
For pyicberg I was using metadata file stored in Azure blob storage
```
static_table = StaticTable.from_metadata(
"abfs://path/metadata/example.metadata.json",
properties={
"adlfs.connection-string": "ADD THIS",
},
)
```
Here is java snippet I used for verification:
```
package com.example;
import org.apache.iceberg.StaticTableOperations;
import org.apache.iceberg.TableMetadata;
import org.apache.iceberg.inmemory.InMemoryFileIO;
import org.apache.iceberg.io.FileIO;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class StaticTableExample {
public static void main(String[] args) throws IOException {
StaticTableExample ex = new StaticTableExample();
ex.start();
}
public void start() throws IOException {
InMemoryFileIO fileIO = new InMemoryFileIO();
String metadataFilePath = "example.metadata.json";
fileIO.addFile(metadataFilePath,
readFileAsBytesNIO(metadataFilePath));
StaticTableOperations ops = new StaticTableOperations(
metadataFilePath,
fileIO
);
TableMetadata meta = ops.current();
System.out.println("Table location: " + meta.location());
}
public byte[] readFileAsBytesNIO(String filePath) throws IOException {
Path path = Path.of(filePath);
return Files.readAllBytes(path);
}
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]