csimplestring / delta-go

Native Delta Lake Implementation in Go
37 stars 7 forks source link

configured log dir does not match provided log dir error #12

Closed barustum closed 1 year ago

barustum commented 1 year ago

I have the following example. I have a container in my storage account named "blobs". I keep getting this error: fail to get protocol and metadata when initializing snapshots: : the configured log dir is azblob://blobs/_delta_log/ but the provided log dir is _delta_log

package main

import ( "log" "os"

delta "github.com/csimplestring/delta-go"

)

func main() { os.Setenv("AZURE_STORAGE_ACCOUNT", "") os.Setenv("AZURE_STORAGE_KEY", "") path := "azblob://blobs" config := delta.Config{ StoreType: "azblob", }

table, err := delta.ForTable(path, config, &delta.SystemClock{})
if err != nil {
    log.Fatal(err)
}

s, err := table.Snapshot()
if err != nil {
    log.Fatal(err)
}

version := s.Version()
log.Println(version)

files, err := s.AllFiles()
if err != nil {
    log.Fatal(err)
}
for _, f := range files {
    log.Println(f.Path)
}

}

csimplestring commented 1 year ago

Hi @barustum thanks for reporting this. We will take a look asap.

csimplestring commented 1 year ago

@barustum after checking the code, we believe it is a bug when handling the log path without additional path. We will fix this asap.

csimplestring commented 1 year ago

@barustum we fixed this bug, you can test the master branch again. Also you can see this updated examples. Thanks for your feedback.