Skip to content

Commit

Permalink
remove wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ohaibbq committed Feb 15, 2024
1 parent 7f7bf52 commit e02bc8f
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions internal/function_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ var windowFuncs = []*WindowFuncInfo{
{Name: "first_value", BindFunc: bindWindowFirstValue},
{Name: "last_value", BindFunc: bindWindowLastValue},
{Name: "nth_value", BindFunc: bindWindowNthValue},
//{Name: "lead", BindFunc: bindWindowLead},
{Name: "lead", BindFunc: bindWindowLead},
{Name: "lag", BindFunc: bindWindowLag},
{Name: "percentile_cont", BindFunc: bindWindowPercentileCont},
{Name: "percentile_disc", BindFunc: bindWindowPercentileDisc},
Expand Down Expand Up @@ -469,50 +469,6 @@ func RegisterFunctions(conn *sqlite3.SQLiteConn) error {
return fmt.Errorf("failed to register collate function: %w", err)
}

if err := conn.RegisterCollation("zetasqlite_collate_nulls_first", func(a, b string) int {
va, _ := DecodeValue(a)
if va == nil {
return -1
}
vb, _ := DecodeValue(b)
if vb == nil {
return 1
}
eq, _ := va.EQ(vb)
if eq {
return 0
}
cond, _ := va.GT(vb)
if cond {
return 1
}
return -1
}); err != nil {
return fmt.Errorf("failed to register collate function: %w", err)
}

if err := conn.RegisterCollation("zetasqlite_collate_nulls_last", func(a, b string) int {
va, _ := DecodeValue(a)
if va == nil {
return 1
}
vb, _ := DecodeValue(b)
if vb == nil {
return -1
}
eq, _ := va.EQ(vb)
if eq {
return 0
}
cond, _ := va.GT(vb)
if cond {
return 1
}
return -1
}); err != nil {
return fmt.Errorf("failed to register collate function: %w", err)
}

for _, values := range normalFuncMap {
for _, v := range values {
if err := conn.RegisterFunc(v.Name, v.Func, true); err != nil {
Expand Down

0 comments on commit e02bc8f

Please sign in to comment.