Giter VIP home page Giter VIP logo

Comments (3)

henrywu2019 avatar henrywu2019 commented on June 30, 2024 1

Huge thanks to @mrsufgi

from athenadriver.

henrywu2019 avatar henrywu2019 commented on June 30, 2024

Thanks @mrsufgi for the great report.

Do you mean the minor bug is from S3 or athenadriver? Athenadriver/Athena doesn't create outputlocation folder automatically. (It does create sub-folders to store query results though.)

If you create local folder in your bucket first, the results should be inside the local folder. If not, could you please show me your code and screenshot so I can reproduce it? Thanks a lot.

from athenadriver.

mrsufgi avatar mrsufgi commented on June 30, 2024

I don't know where the bug originates but I can help u reproduce.

My bucket before running a query:
image

func Test_athenaTasksRepository_GetTaskDuration(t *testing.T) {
	os.Setenv("AWS_SDK_LOAD_CONFIG", "1")
	conf, _ := drv.NewDefaultConfig("s3://athenaplayground/local/", "us-west-2", "none", "none") // using IAM role!
	conn, err := sql.Open(drv.DriverName, conf.Stringify())
	if err != nil {
		log.Fatal(err)
	}

	ar := NewAthenaTasksRepository(conn)

	type args struct {
		id string
	}
	tests := []struct {
		name    string
		ar      domain.TasksRepository
		args    args
		want    int
		wantErr bool
	}{
		{"happy task", ar, args{id: "5eb00783a3f41400105a0e55"}, 1189, false},
	}
	for _, tt := range tests {
		tt := tt
		t.Run(tt.name, func(t *testing.T) {
			got, err := tt.ar.GetTaskDuration(tt.args.id)
			if (err != nil) != tt.wantErr {
				t.Errorf("athenaTasksRepository.GetTaskDuration() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if got != tt.want {
				t.Errorf("athenaTasksRepository.GetTaskDuration() = %v, want %v", got, tt.want)
			}
		})
	}
}

after running the test (which runs simple SELECT query)
image

the local folder I created is empty, and the new empty name folder has a local folder with the results inside that folder.

from athenadriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.