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 io.github.parj.sql; | |
import org.apache.calcite.config.Lex; | |
import org.apache.calcite.sql.*; | |
import org.apache.calcite.sql.fun.SqlStdOperatorTable; | |
import org.apache.calcite.sql.parser.SqlParseException; | |
import org.apache.calcite.sql.parser.SqlParser; | |
import java.util.HashMap; | |
import java.util.List; |
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
# (optional) if using minikube switch docker context | |
eval $(minikube docker-env) | |
# Build Spark | |
bin/docker-image-tool.sh -r docker.io/myrepo -t v3.5 -p kubernetes/dockerfiles/spark/bindings/python/Dockerfile build | |
# Expose K8S API server (minikube) | |
kubectl proxy --port=8080 | |
#Create spark service account and give permissions |
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
Have you ever wondered how computer programs talk to databases? Well, that's where JDBC comes to the rescue! JDBC, which stands for "Java Database Connectivity," is like a magical translator between Java programs and databases. It helps them understand each other's language! | |
Imagine your program wants to store or get some data from a database. JDBC is the friendly bridge that helps them shake hands and exchange information. It makes life easier for developers by handling all the complicated stuff, so they can focus on building awesome apps. Thanks to JDBC, your favorite apps can store and fetch data, making them super cool and smart! | |
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 com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import java.io.BufferedWriter; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStreamWriter; | |
import java.sql.*; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; |
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 java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.sql.*; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class DatabaseToJson { | |
private static final int PAGE_SIZE = 10000; | |
private static final String DB_URL = "jdbc:mysql://localhost:3306/mydatabase"; |
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 java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.sql.*; | |
import org.json.*; | |
public class DatabaseToJson { | |
private static final String DB_URL = "jdbc:mysql://localhost/mydatabase"; | |
private static final String DB_USER = "myusername"; | |
private static final String DB_PASSWORD = "mypassword"; | |
private static final int FETCH_SIZE = 1000; |
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 java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.Writer; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutorService; |
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 java.io.FileWriter; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; |
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 com.fasterxml.jackson.databind.ObjectMapper; | |
import java.io.File; | |
import java.sql.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class DatabaseToJson { | |
private static final String DB_URL = "jdbc:mysql://localhost:3306/mydatabase"; |
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
#First install beautiful soup. Example | |
# pip3 install beautifulsoup4 | |
import requests | |
from bs4 import BeautifulSoup | |
url = 'https://azure.microsoft.com/en-gb/services/' | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, "html.parser") | |
for service in soup.find_all("div", class_="column medium-6 end"): |
NewerOlder