Skip to content
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

Plugin Framework to execute a command in SQL IGNORE ME WORK IN PROCESS #19710

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
be56707
Stage cache add to process
cpegeric Oct 24, 2024
66f7b8e
add stage cache test
cpegeric Oct 24, 2024
9c974b5
Merge branch 'main' into cache
cpegeric Oct 24, 2024
68ff731
move stage and datalink to pkg/
cpegeric Oct 25, 2024
2eb0703
relocate common/fulltext to fulltext
cpegeric Oct 25, 2024
fde1ad1
refactor stage
cpegeric Oct 25, 2024
793f7ad
cleanup
cpegeric Oct 25, 2024
db75b86
Merge branch 'main' into cache
cpegeric Oct 25, 2024
991bd1d
more tests
cpegeric Oct 25, 2024
4b11df9
fix test
cpegeric Oct 25, 2024
6efab1a
add more failed test
cpegeric Oct 25, 2024
b2904a2
Merge branch 'main' into cache
cpegeric Oct 25, 2024
5d85527
fix merge
cpegeric Oct 28, 2024
a44103d
Merge branch 'main' into cache_merge
cpegeric Oct 29, 2024
e45d04d
add plugin_exec
cpegeric Oct 29, 2024
9e3ee48
bug fix
cpegeric Oct 29, 2024
47f30b4
bug fix
cpegeric Oct 29, 2024
adca666
datalink
cpegeric Oct 29, 2024
3caad99
datalink multistream
cpegeric Oct 29, 2024
3bd5a20
update
cpegeric Oct 29, 2024
6cb5090
command line as json
cpegeric Oct 29, 2024
10a3e35
Merge branch 'plugin' into plugin_framework
cpegeric Oct 29, 2024
1318e40
get plain text with pdf and docx file
cpegeric Oct 29, 2024
9a9afa8
comments
cpegeric Oct 29, 2024
f5f61df
add more tests
cpegeric Oct 30, 2024
a590dcc
update tests
cpegeric Oct 30, 2024
685e644
ask function
cpegeric Oct 30, 2024
218acb3
update
cpegeric Oct 30, 2024
a0ee00f
comments
cpegeric Oct 30, 2024
6514411
add multistream.json
cpegeric Oct 30, 2024
a507a9f
Merge branch 'main' into plugin_framework
cpegeric Oct 30, 2024
713355b
use bash script to replace python
cpegeric Oct 30, 2024
65462c2
add more failed tests and bug fix
cpegeric Oct 30, 2024
0217776
wasm
cpegeric Nov 1, 2024
615ddd1
wasm_run_table
cpegeric Nov 1, 2024
d174197
add tests and cat.wasm
cpegeric Nov 1, 2024
df421be
update cat.wasm
cpegeric Nov 1, 2024
7f27651
change comments
cpegeric Nov 1, 2024
70fc158
Merge branch 'main' into plugin_framework
cpegeric Nov 1, 2024
b94cfdc
wasm support stage URL
cpegeric Nov 1, 2024
a5c5a14
remove script
cpegeric Nov 1, 2024
b1eea97
upgrade go-sdk version
cpegeric Nov 1, 2024
5363885
grpc.Dail is deprecated.
cpegeric Nov 4, 2024
628dcd6
change https:// to stage://
cpegeric Nov 4, 2024
54ca795
moplugin
cpegeric Nov 4, 2024
aa0cd3b
Merge branch 'main' into plugin_framework
cpegeric Nov 4, 2024
2a9d93a
allowed_hosts in config
cpegeric Nov 5, 2024
8f55768
fix docx parsing
cpegeric Nov 5, 2024
e08b09f
check error
cpegeric Nov 5, 2024
6b54a8c
set variable to global and cannot change in runtime
cpegeric Nov 6, 2024
c223f1b
set variable to global and dynamic
cpegeric Nov 6, 2024
e67303b
wasm url must be const
cpegeric Nov 7, 2024
f8163dc
Merge branch 'main' into plugin_framework
cpegeric Nov 7, 2024
0f43474
Merge branch 'main' into plugin_framework
cpegeric Nov 12, 2024
89c1663
Merge branch 'main' into plugin_framework
cpegeric Nov 15, 2024
b9c243f
Merge branch 'main' into plugin_framework
cpegeric Nov 21, 2024
7ee00a5
Merge branch 'main' into plugin_framework
cpegeric Nov 29, 2024
e8f59c7
check empty string and return 0 rows
cpegeric Nov 29, 2024
3a401ca
merge fix
cpegeric Jan 7, 2025
e3b4015
go mod tidy
cpegeric Jan 7, 2025
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
15 changes: 10 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.33.1
github.com/aws/smithy-go v1.22.1
github.com/axiomhq/hyperloglog v0.0.0-20230201085229-3ddf4bad03dc
github.com/buger/jsonparser v1.1.1
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5
github.com/cespare/xxhash/v2 v2.2.0
github.com/cespare/xxhash/v2 v2.3.0
github.com/cockroachdb/errors v1.9.1
github.com/confluentinc/confluent-kafka-go/v2 v2.4.0
github.com/containerd/cgroups/v3 v3.0.1
Expand All @@ -31,7 +32,7 @@ require (
github.com/dolthub/maphash v0.1.0
github.com/dslipak/pdf v0.0.2
github.com/elastic/gosigar v0.14.2
github.com/extism/go-sdk v1.3.0
github.com/extism/go-sdk v1.6.0
github.com/fagongzi/goetty/v2 v2.0.3-0.20230628075727-26c9a2fd5fb8
github.com/fagongzi/util v0.0.0-20210923134909-bccc37b5040d
github.com/felixge/fgprof v0.9.6-0.20240831122612-49987e680f04
Expand Down Expand Up @@ -87,7 +88,7 @@ require (
golang.org/x/sync v0.8.0
golang.org/x/sys v0.26.0
gonum.org/v1/gonum v0.14.0
google.golang.org/grpc v1.62.1
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)
Expand All @@ -101,6 +102,7 @@ require (
github.com/clbanning/mxj v1.8.4 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
Expand All @@ -110,6 +112,7 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/gosimple/slug v1.13.1 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20240805132620-81f5be970eca // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/native v1.1.0 // indirect
Expand All @@ -129,7 +132,9 @@ require (
github.com/rs/xid v1.6.0 // indirect
github.com/segmentio/asm v1.1.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/tetratelabs/wazero v1.7.3 // indirect
github.com/tetratelabs/wabin v0.0.0-20230304001439-f6f874872834 // indirect
github.com/tetratelabs/wazero v1.8.1-0.20240916092830-1353ca24fef0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/text v0.19.0 // indirect
Expand Down Expand Up @@ -204,7 +209,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

Expand Down
82 changes: 44 additions & 38 deletions go.sum

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion pkg/datalink/docx/docx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func TestOpenWordFileValidFile(t *testing.T) {
if !strings.Contains(string(doc), "This is a word file") {
t.Errorf("Error reading document.xml %s ", doc)
}
fmt.Printf("%s", err)
}

func TestParseText(t *testing.T) {
Expand Down Expand Up @@ -196,3 +195,19 @@ func TestParseTextFromReader(t *testing.T) {
}
//fmt.Printf(doc)
}

func TestWiki(t *testing.T) {
dat, err := os.ReadFile("testfiles/wiki.docx")
if err != nil {
t.Errorf("read file error %s", err)
}

doctext, err := ParseTextFromReader(bytes.NewReader(dat), int64(len(dat)))
if err != nil {
t.Errorf("parsing test.docx should work \n %s", err)
}

if !strings.Contains(doctext, "In the philosophy of religion") {
t.Errorf("parsed text does not contain expected text \n %s", doctext)
}
}
Binary file added pkg/datalink/docx/testfiles/wiki.docx
Binary file not shown.
9 changes: 7 additions & 2 deletions pkg/datalink/docx/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ type Style struct {
Val string `xml:"val,attr"`
}
type Row struct {
Text string `xml:"t"`
Texts []string `xml:"t"`
}

// methods
func (w WordDocument) AsText() string {
text := ""
for _, v := range w.Paragraphs {
for _, rv := range v.Rows {
text += rv.Text
for i, tv := range rv.Texts {
if i > 0 {
text += "\n"
}
text += tv
}
}
text += "\n"
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/frontend/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,14 @@ var gSysVarsDefs = map[string]SystemVariable{
Type: InitSystemVariableIntType("min_examined_row_limit", 0, 4294967295, false),
Default: int64(0),
},
"moplugin_allowed_hosts": {
Name: "moplugin_allowed_hosts",
Scope: ScopeGlobal,
Dynamic: true,
SetVarHintApplies: false,
Type: InitSystemVariableStringType("moplugin_allowed_hosts"),
Default: "localhost",
},
"myisam_data_pointer_size": {
Name: "myisam_data_pointer_size",
Scope: ScopeGlobal,
Expand Down
Loading