Skip to content

Commit

Permalink
rename func to isCreatingCTASTable
Browse files Browse the repository at this point in the history
  • Loading branch information
muroon committed Sep 29, 2021
1 parent e688b28 commit f3c0148
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (c *conn) runQuery(ctx context.Context, query string) (driver.Rows, error)
// mode ctas
var ctasTable string
var afterDownload func() error
if isCreateingCTASTable(isSelect, resultMode) {
if isCreatingCTASTable(isSelect, resultMode) {
// Create AS Select
ctasTable = fmt.Sprintf("tmp_ctas_%v", strings.Replace(uuid.NewV4().String(), "-", "", -1))
query = fmt.Sprintf("CREATE TABLE %s WITH (format='TEXTFILE') AS %s", ctasTable, query)
Expand Down Expand Up @@ -216,7 +216,7 @@ func (c *conn) prepareContext(ctx context.Context, query string) (driver.Stmt, e
// ctas
var ctasTable string
var afterDownload func() error
if isCreateingCTASTable(isSelect, resultMode) {
if isCreatingCTASTable(isSelect, resultMode) {
// Create AS Select
ctasTable = fmt.Sprintf("tmp_ctas_%v", strings.Replace(uuid.NewV4().String(), "-", "", -1))
query = fmt.Sprintf("CREATE TABLE %s WITH (format='TEXTFILE') AS %s", ctasTable, query)
Expand Down Expand Up @@ -289,6 +289,6 @@ func isCTASQuery(query string) bool {
return regexp.MustCompile(`(?i)^CREATE.+AS\s+SELECT`).Match([]byte(query))
}

func isCreateingCTASTable(isSelect bool, resultMode ResultMode) bool {
func isCreatingCTASTable(isSelect bool, resultMode ResultMode) bool {
return isSelect && resultMode == ResultModeGzipDL
}

0 comments on commit f3c0148

Please sign in to comment.