This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SqlSelect extends SqlCall { | |
//~ Static fields/initializers --------------------------------------------- | |
// constants representing operand positions | |
public static final int FROM_OPERAND = 2; | |
public static final int WHERE_OPERAND = 3; | |
public static final int HAVING_OPERAND = 5; | |
SqlNodeList keywordList; | |
SqlNodeList selectList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LogicalProject(subset=[rel#28:Subset#3.ENUMERABLE.[]], EMPNO=[$0], GENDER=[$2], NAME=[$1]): rowcount = 15.0, cumulative cost = {15.0 rows, 45.0 cpu, 0.0 io}, id = 23 | |
LogicalFilter(subset=[rel#22:Subset#2.NONE.[]], condition=[=($1, 'John')]): rowcount = 15.0, cumulative cost = {15.0 rows, 100.0 cpu, 0.0 io}, id = 21 | |
LogicalProject(subset=[rel#20:Subset#1.NONE.[]], EMPNO=[$0], NAME=[$1], GENDER=[$3]): rowcount = 100.0, cumulative cost = {100.0 rows, 300.0 cpu, 0.0 io}, id = 19 | |
CsvTableScan(subset=[rel#18:Subset#0.ENUMERABLE.[]], table=[[SALES, EMPS]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2019-06-03 20:49:33,973 [main] DEBUG - Cheapest plan: | |
EnumerableProject(EMPNO=[$0], GENDER=[$2], NAME=[$1]): rowcount = 15.0, cumulative cost = {71.66666666666667 rows, 187.08333333333334 cpu, 0.0 io}, id = 59 | |
EnumerableFilter(condition=[=($1, 'John')]): rowcount = 15.0, cumulative cost = {56.66666666666667 rows, 142.08333333333334 cpu, 0.0 io}, id = 58 | |
CsvTableScan(table=[[SALES, EMPS]], fields=[[0, 1, 3]]): rowcount = 100.0, cumulative cost = {41.66666666666667 rows, 42.083333333333336 cpu, 0.0 io}, id = 57 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1 */ org.apache.calcite.DataContext root; | |
/* 2 */ | |
/* 3 */ public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root0) { | |
/* 4 */ root = root0; | |
/* 5 */ final org.apache.calcite.linq4j.Enumerable _inputEnumerable = ((org.apache.calcite.adapter.csv.CsvTranslatableTable) root.getRootSchema().getSubSchema("SALES").getTable("EMPS")).project(root, new int[] { | |
/* 6 */ 0, | |
/* 7 */ 1, | |
/* 8 */ 3}); | |
/* 9 */ return new org.apache.calcite.linq4j.AbstractEnumerable(){ | |
/* 10 */ public org.apache.calcite.linq4j.Enumerator enumerator() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import pandas as pd | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
def load_data(): | |
return [{"a": "k1", "b": 2}, {"a": "k2", "b": 4}, {"a": "k3", "b": 5}, {"a": "k1", "b": 15}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://www.google.com'); | |
await page.screenshot({path: 'screenshot.png'}); | |
await browser.close(); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
import os | |
import json | |
import threading | |
from flask import Flask, jsonify | |
from uwsgidecorators import postfork | |
import pystuck | |
pystuck.run_server(unix_socket='/tmp/utd-master') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.wrap_trap.calcite_avro_sample; | |
import org.apache.calcite.model.ModelHandler; | |
import org.apache.calcite.schema.Schema; | |
import org.apache.calcite.schema.SchemaFactory; | |
import org.apache.calcite.schema.SchemaPlus; | |
import java.io.File; | |
import java.util.Map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AvroSchema extends AbstractSchema { | |
private Map<String, Table> tableMap; | |
private File directory; | |
public AvroSchema(File directory) { | |
this.directory = directory; | |
} | |
@Override | |
public Map<String, Table> getTableMap() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public RelDataType getRowType(RelDataTypeFactory relDataTypeFactory) { | |
JavaTypeFactory typeFactory = (JavaTypeFactory) relDataTypeFactory; | |
List<Pair<String, RelDataType>> ret = schema.getFields().stream().map(field -> { | |
Schema.Type avroFieldType = field.schema().getType(); | |
if (avroFieldType == Schema.Type.UNION) { | |
avroFieldType = getAvroNullableField(field); | |
} | |
RelDataType relDataType = AvroFieldType.of(avroFieldType).toType(typeFactory); |