Skip to content

Instantly share code, notes, and snippets.

View vibhatha's full-sized avatar
🏠
Working from home

Vibhatha Lakmal Abeykoon vibhatha

🏠
Working from home
View GitHub Profile
@vibhatha
vibhatha / t1_substrait_plan.txt
Created June 1, 2023 13:40
Sample substrait plan
extension_uris {
  extension_uri_anchor: 1
  uri: "https://github.com/substrait-io/substrait/blob/main/extensions/functions_boolean.yaml"
}
extension_uris {
  extension_uri_anchor: 2
  uri: "https://github.com/substrait-io/substrait/blob/main/extensions/functions_comparison.yaml"
}
extensions {
  extension_function {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vibhatha
vibhatha / sample_arrow_table.cc
Created March 7, 2023 15:09
Sample An Arrow Table Example
#include <arrow/api.h>
#include <arrow/compute/api.h>
#include <iostream>
#include <random>
template <typename TYPE,
typename = typename std::enable_if<arrow::is_number_type<TYPE>::value |
arrow::is_boolean_type<TYPE>::value |
arrow::is_temporal_type<TYPE>::value>::type>
arrow::Result<std::shared_ptr<arrow::Array>> GetArrayDataSample(
"""
Version 4
---------
Install Libraries
-----------------
On Mac M1
----------
pip install ibis ibis-substrait pyarrow duckdb-engine
@vibhatha
vibhatha / generate_compute_agg_queries.py
Last active March 2, 2023 16:29
Generate Substrait Queries with Ibis for Compute Aggregate
"""
Version 4
---------
Install Libraries
-----------------
On Mac M1
----------
pip install ibis ibis-substrait pyarrow duckdb-engine
@vibhatha
vibhatha / generate_substrait_projections_with_names_v2.py
Created January 20, 2023 05:19
Generate Substrait Plans in Google Proto Text Format
"""
Version 3
---------
Update to naming used for projection
Function Performed
------------------
Generate Substrait Plans and Corresponding SQL via Ibis
"""
Version 2
---------
Update to naming used for projection
Function Performed
------------------
Generate Substrait Plans and Corresponding SQL via Ibis
@vibhatha
vibhatha / generate_substrait_projections.py
Last active January 19, 2023 09:12
Generate Substrait Projections with Ibis
"""
Generate Substrait Plans and Corresponding SQL via Ibis
Requirements
------------
pip install ibis ibis-substrait pyarrow
Run Script
----------
python generate_substrait_projections.py <path-to-save-directory>
# Doxyfile 1.8.17
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "PyVelox"
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
@vibhatha
vibhatha / launch_velox.json
Last active November 30, 2022 08:11
Velox VS Code Debug Sample Launch JSON
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Example 1",
"type": "cppdbg",
"request": "launch",