Trino Local Dev (The Hard Way)

Data Al Dente

Home | Posts | About Me

Created

Updated

Trino Version 405

Need to start docker engine first

https://github.com/trinodb/trino

./mvnw clean install -DskipTests

Using IntelliJ community edition

can run going to try running tpchqueryrunner class via IDE

localhost:8080

does mvn package fail a test?

https://trino.io/docs/current/installation/deployment.html#python

 ~/DSRP/trino
./mvnw clean install -DskipTests # remove skipTests to run tests obvy
 ~/DSRP
mkdir trinodata
 /Users/nate/DSRP/trino/core/trino-server/target/trino-server-*-SNAPSHOT
mkdir etc
cd etc
# config.properties
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
discovery.uri=http://localhost:8080
# jvm.config
-server
-Xmx16G
-XX:InitialRAMPercentage=80
-XX:MaxRAMPercentage=80
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
-XX:+UnlockDiagnosticVMOptions
-XX:+UseAESCTRIntrinsics
# Disable Preventive GC for performance reasons (JDK-8293861)
-XX:-G1UsePreventiveGC
# node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/Users/nate/DSRP/trinodata
 ..
./bin/launcher run
 /Users/nate/DSRP/trino/client/trino-cli/target
java -jar trino-cli-*-SNAPSHOT-executable.jar

for jdb debugging

better just add to top of etc/jvm.config

-agentlib:jdwp=transport=dt_socket,address=9876,server=y,suspend=n

can add multiple colon separated sourcepaths to jdb to get list and other src stuff working

 -sourcepath core/trino-main/src/main/java -attach localhost:9876

ran launcher

ran client as normal

 -attach localhost:9876
stop at io.trino.server.protocol.Query.create
# run "select 1;" from client
where
threads
print session
list
step over
step in
step out
# ctrl-d to exit

can i put debug config in jvm file? yes, just add at top

what is the RPM and other launchers from find? i think some fancy thing for linux

there’s lots of query runner classes for other things like iceberg, etc

develomentserver (errs becase missing config, prob need to add files somewhere…)

there’s a client cli you run via jar? example cmd in trino dev cheat sheet? client/trino-cli/target/trino-cli-*-executable.jar --debug --server localhost:8080

catalogs are config’d via etc catalog files i think

provisio

Launcher for Airlift applications

the unit test story seems pretty dang nice

git checkout 405, git checkout -b nate/405-code-tour-<component>

you should probably ignore all this and just look at https://gist.github.com/findepi/04c96f0f60dcc95329f569bb0c44a0cd

trino contributing

TODO fixes per pr feedback use fixup thing referenced in contrib guidelines

TODO link issues with pull requests that will close them https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

https://trino.io/development/process.html

# fixup on pr DONT FORGET THE ~1 on rebase
git log # copy top commit hash
git add .
git commit --fixup=bba93af86f8beba55efb775c3865b2ca52f27580
git rebase -i --autosquash52f27580~1
git push --force-with-lease # don't do this?
# notify reviewers it's ready again

# ensure docker running
docs/build

test style etc pre push checks

./mvnw -T2 checkstyle:check@checkstyle
# run relevant test classes via intellij