This file contains 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
object DB { | |
import org.apache.spark.sql._ | |
import org.apache.spark.sql.types._ | |
var url = "jdbc:sqlserver://..." | |
var props = new java.util.Properties() | |
var autoCommit = true | |
var spark = SparkSession.getActiveSession.get | |
def execute(conn: java.sql.Connection, query: String): DataFrame = { |
This file contains 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 java.util.Random; | |
import java.util.concurrent.ConcurrentHashMap; | |
import javafx.animation.AnimationTimer; | |
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.Group; | |
import javafx.scene.canvas.Canvas; | |
import javafx.scene.canvas.GraphicsContext; | |
import javafx.scene.paint.Color; |
This file contains 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
open -a "Google Chrome" --args --proxy-server=http://localhost:8080 --ignore-certificate-errors |
This file contains 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
//////////////////////////////////////////////////////////////// | |
// == Parquet read == | |
//////////////////////////////////////////////////////////////// | |
import org.apache.hadoop.conf.Configuration | |
import org.apache.hadoop.fs.Path | |
import org.apache.hadoop.mapreduce._ | |
import org.apache.hadoop.mapreduce.lib.input.FileSplit | |
import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl | |
import org.apache.parquet.hadoop.ParquetInputSplit | |
import org.apache.parquet.hadoop.ParquetRecordReader |
This file contains 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
def clazz[T](cls: Class[T], encoders: Seq[(String, ExpressionEncoder[_])]): ExpressionEncoder[T] = { | |
encoders.foreach { case (_, enc) => enc.assertUnresolved() } | |
val schema = StructType(encoders.map { | |
case (fieldName, e) => | |
val (dataType, nullable) = if (e.flat) { | |
e.schema.head.dataType -> e.schema.head.nullable | |
} else { | |
e.schema -> true | |
} |
This file contains 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
final class Example { | |
void /* test */ func() { | |
String a = "a"; | |
String b = "a" + b + "c()"; | |
Buffer buf = "test" + "new Buffer() {};"; | |
HashSet<String> test = new HashSet<String>(); | |
} | |
public int get_int() { |
This file contains 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 org.apache.spark.sql.sadikovi | |
import java.io.{ObjectInputStream, ObjectOutputStream} | |
import java.util.UUID | |
import org.apache.hadoop.conf.Configuration | |
import org.apache.hadoop.fs.Path | |
import org.apache.hadoop.mapreduce.{JobContext, TaskAttemptContext} | |
import org.apache.spark.internal.io._ |
This file contains 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
diff --git a/grammars/java.cson b/grammars/java.cson | |
index cb9947a..399c914 100644 | |
--- a/grammars/java.cson | |
+++ b/grammars/java.cson | |
@@ -109,6 +109,9 @@ | |
{ | |
'include': '#code' | |
} | |
+ { | |
+ 'include': '#module' |
This file contains 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
// ---------------------------------------------------------------------- | |
// Statistics updates | |
struct MutableStatisticsBuffer<T: DataType> { | |
typed: TypedStatistics<T>, | |
sort_order: SortOrder | |
} | |
impl<T: DataType> MutableStatisticsBuffer<T> { | |
pub fn new(column_order: ColumnOrder, is_min_max_deprecated: bool) -> Self { |
This file contains 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
use std::fmt; | |
#[derive(Clone, Debug)] | |
pub struct DateTime { | |
/// Seconds after the minute - [0, 59] | |
pub sec: i32, | |
/// Minutes after the hour - [0, 59] | |
pub min: i32, | |
/// Hours after midnight - [0, 23] | |
pub hour: i32, |
NewerOlder