Coder Social home page Coder Social logo

databend-go's People

Contributors

everpcpc avatar flaneur2020 avatar hantmac avatar youngsofun avatar zhihanz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

databend-go's Issues

NG return 404

i use ng for databend-query
go driver SDK is 0.4.8
i use db.Exec("INSERT INTO testd VALUES('111.111.111.111',?)",x) ,the ng return 2 logs , post and get was success, post url and get url go to same node.
but
my code like this:
scope, err := db.Begin()
batch, err := scope.Prepare(fmt.Sprintf("INSERT INTO %s VALUES", "testd"))
for i := 0; i < 10; i++ {
, err = batch.Exec(i,x)
}
scope.Commit()
the ng return logs post 200 , get 404 insert failed :
1703745676.977 "10.49.2.134" 422 "POST" "10.49.2.187" "/v1/query" "" "10.49.2.187" 8000 "/v1/query" "-" "HTTP/1.1" 1557 1239 200 0.008 "-" "databend-go/0.4.2" "-" "-" "-" "-" "10.49.2.57:8000" "-" [28/Dec/2023:06:41:16 +0000]
1703745676.983 "10.49.2.134" 323 "GET" "10.49.2.187" "/v1/query/685870bc-8e5a-4098-8715-793f70d08a10/final" "_" "10.49.2.187" 8000 "/v1/query/685870bc-8e5a-4098-8715-793f70d08a10/final" "-" "HTTP/1.1" 241 118 404 0.005 "-" "databend-go/0.4.2" "-" "-" "-" "-" "10.49.2.207:8000" "-" [28/Dec/2023:06:41:16 +0000]
databend-query log timeout 60s
the post url and get get url not go to same node. so is a bug?

Empty string value show as NULL when insert

package main

import (
	"database/sql"
	"fmt"

	_ "github.com/datafuselabs/databend-go"
)

func main() {
	db, err := sql.Open("databend", "http://databend:databend@localhost:8000")
	if err != nil {
		fmt.Println(err)
		return
	}
	scope, err := db.Begin()
	if err != nil {
		return
	}

	batch, err := scope.Prepare(fmt.Sprintf("INSERT INTO %s VALUES", "gottt"))

	for i := 0; i < 10; i++ {
		name := fmt.Sprintf("name%d", i)
		if i == 9 {
			name = ""
		}
		_, err = batch.Exec(i, name, i*2)
	}

	err = scope.Commit()
}

when id = 9, the name is NULL:
image

But the name should be "" (empty string).

Reason

When execute batch insert, the csv file generated is:

0,name0,0
1,name1,2
2,name2,4
3,name3,6
4,name4,8
5,name5,10
6,name6,12
7,name7,14
8,name8,16
9,,18

databend kernet will handle the empty string as NULL when copy into.

handles ProvisionWarehouseTimeout on provisioning timeout

you may get a ProvisionWarehouseTimeout on cloud resource exhausted. This error is safe to retry, because the query is not actually sent to the warehouse.

with this error get handled, the sdk could be more robust on access cloud warehouse from databend cloud.

Add max_active_session test

Should make a test as the following steps:

  1. set max_active_session=10
  2. do insert, update, delete concurrently

Then there should not has exceed max session error.

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.