MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / TestSQLFSNewSQLWriter

Function TestSQLFSNewSQLWriter

go/sqlfs/sql_writer_test.go:27–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestSQLFSNewSQLWriter(t *testing.T) {
28 createSQLFSTestingDatabaseOnce.Do(createSQLFSTestingDatabase)
29 db := database.GetTestingDBSingleton()
30 a := assert.New(t)
31
32 if db.DriverName == "hive" {
33 t.Skip("Skip as SQLFLOW_TEST_DB is Hive")
34 }
35 t.Logf("Confirm executed with %s", db.DriverName)
36
37 tbl := fmt.Sprintf("%s.unittest%d", testDatabaseName, rand.Int())
38 w, e := newSQLWriter(db, tbl, bufSize)
39 a.NoError(e)
40 a.NotNil(w)
41 defer w.Close()
42
43 has, e1 := hasTable(db.DB, tbl)
44 a.NoError(e1)
45 a.True(has)
46
47 a.NoError(dropTableIfExists(db.DB, tbl))
48}
49
50func TestSQLFSSQLWriterWriteAndRead(t *testing.T) {
51 createSQLFSTestingDatabaseOnce.Do(createSQLFSTestingDatabase)

Callers

nothing calls this directly

Calls 6

GetTestingDBSingletonFunction · 0.92
newSQLWriterFunction · 0.85
hasTableFunction · 0.85
IntMethod · 0.80
dropTableIfExistsFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected