From e02bc8f565b230b2dcaac67e9aef5bb463fb4ef5 Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Thu, 15 Feb 2024 14:15:14 -0800 Subject: [PATCH] remove wip --- internal/function_register.go | 46 +---------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/internal/function_register.go b/internal/function_register.go index ec5281e..5ff3371 100644 --- a/internal/function_register.go +++ b/internal/function_register.go @@ -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}, @@ -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 {