Skip to content

Instantly share code, notes, and snippets.

View wendigo's full-sized avatar
🧭
Time isn't slowing, just speed, it's all we're knowing

Mateusz "Serafin" Gajewski wendigo

🧭
Time isn't slowing, just speed, it's all we're knowing
View GitHub Profile
@wendigo
wendigo / TestSegmentClient.java
Last active February 21, 2025 10:50
Out-of-bound data retrieval using spooling protocol
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@wendigo
wendigo / arrow.md
Last active February 9, 2025 20:13
Arrow vs JSON

Arrow uncompressed

Query finished in 3.063791375 s
Now reading data out of band
Data size is 15276072
Data size is 30550888
Data size is 30548648
Data size is 30550080
Data size is 30549344
Data size is 30549056
@wendigo
wendigo / TestSegmentClient.java
Created February 9, 2025 13:26
Reading all segments after query is finished
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@wendigo
wendigo / TestClient.java
Created February 9, 2025 12:45
List all segments
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@wendigo
wendigo / bug.java
Last active April 18, 2024 10:05
IntelliJ isEqualTo bug
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.AssertProvider;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class SerafinTest
{
@Test
public void testIntelliJBug()
@wendigo
wendigo / InjectionTest.java
Last active January 4, 2024 16:03
Named Guice bindings
import com.google.common.base.MoreObjects;
import com.google.inject.Binder;
import com.google.inject.ConfigurationException;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.name.Named;
import com.google.inject.name.Names;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.configuration.AbstractConfigurationAwareModule;
@wendigo
wendigo / snappy_compress.java
Last active June 20, 2023 13:25
Java Foreign Linker + jextract
import java.lang.foreign.Arena;
import java.lang.foreign.MemorySegment;
import static io.airlift.slice.Preconditions.verify;
import static io.airlift.slice.snappy.snappy_c_h.SNAPPY_OK;
import static java.lang.foreign.ValueLayout.JAVA_CHAR;
import static java.lang.foreign.ValueLayout.JAVA_LONG;
public class SnappyTest
{
@wendigo
wendigo / jmh_benchmark_cached_analyzer.json
Last active April 12, 2022 16:35
jmh_benchmark_cached_analyzer.json
[
{
"jmhVersion" : "1.32",
"benchmark" : "io.trino.sql.planner.BenchmarkPlanner.planLargeInQuery",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/mateuszgajewski/.sdkman/candidates/java/17.0.0-zulu/zulu-17.jdk/Contents/Home/bin/java",
"jvmArgs" : [
"-javaagent:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.169/IntelliJ IDEA 2022.1 EAP.app/Contents/lib/idea_rt.jar=63361:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.169/IntelliJ IDEA 2022.1 EAP.app/Contents/bin",
@wendigo
wendigo / jmh_literal_as_string.json
Last active April 8, 2022 16:57
jmh_literal_as_string.json
[
{
"jmhVersion" : "1.32",
"benchmark" : "io.trino.sql.planner.BenchmarkPlanner.planLargeInQuery",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/mateuszgajewski/.sdkman/candidates/java/17.0.0-zulu/zulu-17.jdk/Contents/Home/bin/java",
"jvmArgs" : [
"-javaagent:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.169/IntelliJ IDEA 2022.1 EAP.app/Contents/lib/idea_rt.jar=61289:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.169/IntelliJ IDEA 2022.1 EAP.app/Contents/bin",
@wendigo
wendigo / jmh_literal_master.json
Created April 7, 2022 22:20
jmh_literal_master.json
[
{
"jmhVersion" : "1.32",
"benchmark" : "io.trino.sql.planner.BenchmarkPlanner.planLargeInQuery",
"mode" : "avgt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/mateuszgajewski/.sdkman/candidates/java/17.0.0-zulu/zulu-17.jdk/Contents/Home/bin/java",
"jvmArgs" : [
"-javaagent:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.93/IntelliJ IDEA 2022.1 EAP.app/Contents/lib/idea_rt.jar=56000:/Users/mateuszgajewski/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/221.5080.93/IntelliJ IDEA 2022.1 EAP.app/Contents/bin",