diff --git a/flow/connectors/kafka/kafka.go b/flow/connectors/kafka/kafka.go index 920d14c872..f007922f46 100644 --- a/flow/connectors/kafka/kafka.go +++ b/flow/connectors/kafka/kafka.go @@ -137,7 +137,7 @@ func (c *KafkaConnector) SyncRecords(ctx context.Context, req *model.SyncRecords var fn *lua.LFunction var ls *lua.LState if req.Script != "" { - ls = lua.NewState(lua.Options{SkipOpenLibs: true}) + ls = lua.NewState(lua.Options{SkipOpenLibs: true, IncludeGoStackTrace: true}) defer ls.Close() ls.SetContext(wgCtx) for _, pair := range []struct { diff --git a/flow/pua/peerdb.go b/flow/pua/peerdb.go index bbcf9cc508..44dade8a89 100644 --- a/flow/pua/peerdb.go +++ b/flow/pua/peerdb.go @@ -147,7 +147,7 @@ func LuaRowColumns(ls *lua.LState) int { _, row := LuaRow.Check(ls, 1) tbl := ls.CreateTable(len(row.ColToValIdx), 0) for col, idx := range row.ColToValIdx { - tbl.RawSetInt(idx, lua.LString(col)) + tbl.RawSetInt(idx+1, lua.LString(col)) } ls.Push(tbl) return 1 @@ -507,8 +507,10 @@ func LuaTimeIndex(ls *lua.LState) int { ls.Push(LuaI64.New(ls, tm.UnixMicro())) case "unix_milli": ls.Push(LuaI64.New(ls, tm.UnixMilli())) - case "unix": + case "unix_second": ls.Push(LuaI64.New(ls, tm.Unix())) + case "unix": + ls.Push(lua.LNumber(float64(tm.Unix()) + float64(tm.Nanosecond())/1e9)) case "year": ls.Push(lua.LNumber(tm.Year())) case "month":