Skip to content

Fixed typo #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions internal/engine/dolphin/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func identifier(id string) string {
return strings.ToLower(id)
}

func NewIdentifer(t string) *ast.String {
func NewIdentifier(t string) *ast.String {
return &ast.String{Str: identifier(t)}
}

Expand Down Expand Up @@ -289,12 +289,12 @@ func (c *cc) convertCreateTableStmt(n *pcast.CreateTableStmt) ast.Node {
func (c *cc) convertColumnNameExpr(n *pcast.ColumnNameExpr) *ast.ColumnRef {
var items []ast.Node
if schema := n.Name.Schema.String(); schema != "" {
items = append(items, NewIdentifer(schema))
items = append(items, NewIdentifier(schema))
}
if table := n.Name.Table.String(); table != "" {
items = append(items, NewIdentifer(table))
items = append(items, NewIdentifier(table))
}
items = append(items, NewIdentifer(n.Name.Name.String()))
items = append(items, NewIdentifier(n.Name.Name.String()))
return &ast.ColumnRef{
Fields: &ast.List{
Items: items,
Expand Down Expand Up @@ -374,9 +374,9 @@ func (c *cc) convertFuncCallExpr(n *pcast.FuncCallExpr) ast.Node {
// TODO: Deprecate the usage of Funcname
items := []ast.Node{}
if schema != "" {
items = append(items, NewIdentifer(schema))
items = append(items, NewIdentifier(schema))
}
items = append(items, NewIdentifer(name))
items = append(items, NewIdentifier(name))

args := &ast.List{}
for _, arg := range n.Args {
Expand Down Expand Up @@ -530,7 +530,7 @@ func (c *cc) convertCommonTableExpression(n *pcast.CommonTableExpression) *ast.C

columns := &ast.List{}
for _, col := range n.ColNameList {
columns.Items = append(columns.Items, NewIdentifer(col.String()))
columns.Items = append(columns.Items, NewIdentifier(col.String()))
}

return &ast.CommonTableExpr{
Expand Down Expand Up @@ -613,7 +613,7 @@ func (c *cc) convertValueExpr(n *driver.ValueExpr) *ast.A_Const {
func (c *cc) convertWildCardField(n *pcast.WildCardField) *ast.ColumnRef {
items := []ast.Node{}
if t := n.Table.String(); t != "" {
items = append(items, NewIdentifer(t))
items = append(items, NewIdentifier(t))
}
items = append(items, &ast.A_Star{})

Expand All @@ -636,7 +636,7 @@ func (c *cc) convertAggregateFuncExpr(n *pcast.AggregateFuncExpr) *ast.FuncCall
},
Funcname: &ast.List{
Items: []ast.Node{
NewIdentifer(name),
NewIdentifier(name),
},
},
Args: &ast.List{},
Expand Down Expand Up @@ -819,7 +819,7 @@ func (c *cc) convertDropDatabaseStmt(n *pcast.DropDatabaseStmt) ast.Node {
return &ast.DropSchemaStmt{
MissingOk: !n.IfExists,
Schemas: []*ast.String{
NewIdentifer(n.Name),
NewIdentifier(n.Name),
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/engine/dolphin/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func toList(node pcast.Node) *ast.List {
switch n := node.(type) {
case *pcast.TableName:
if schema := n.Schema.String(); schema != "" {
items = append(items, NewIdentifer(schema))
items = append(items, NewIdentifier(schema))
}
items = append(items, NewIdentifer(n.Name.String()))
items = append(items, NewIdentifier(n.Name.String()))
default:
return nil
}
Expand Down