Skip to content

Instantly share code, notes, and snippets.

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

Abhishek Sengupta shredder47

🏠
Working from home
  • The Home Depot
  • India
View GitHub Profile
@shredder47
shredder47 / maven-create.txt
Created November 5, 2020 14:10
Maven Project Creation
mvn archetype:generate -DgroupId=com.shredder -DartifactId=livy-experiment -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
@shredder47
shredder47 / scala-install.txt
Created November 5, 2020 14:14
Scala 2.12 Installation
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget https://downloads.lightbend.com/scala/2.12.12/scala-2.12.12.deb
sudo dpkg -i scala-2.12.12.deb
sudo apt-get update
@shredder47
shredder47 / Steps.txt
Created November 18, 2020 10:43
Cloudera QuickStart VM , Spark Version Upgrade
java -version
sudo yum remove java
sudo yum install java-1.8.0-openjdk
source ~/.bash_profile
Download Spark 2.4.7 With Hadoop 2.6 (Tar)
Extract contents.
Move the contents of the folder to :
/usr/local/spark
@shredder47
shredder47 / spark jdbc connection.scala
Created November 21, 2020 10:33
Connect MySQL from Spark 2.x
val spark = SparkSession
.builder()
.appName("Spark")
.master("local[*]")
.enableHiveSupport()
.getOrCreate()
spark.sparkContext.setLogLevel("ERROR")
@shredder47
shredder47 / Git Origin Add OR Remove.txt
Last active January 6, 2021 18:04
Git Origin Remove and Add New
git init
git add .
git commit -m "question1 added"
git branch -M main
git remote add origin remote_url
git push -u origin main
//For removing exising origin and adding new
git remote show origin
---------------
SUBSTRING_INDEX
---------------
SUBSTRING_INDEX(column_name,' ' , 1) // Not 0 Indexed!
--------
to_date
--------
to_date(col_with_date_as_string,'MM/yyyy') //parse date string to date type using the specified format - Returns it as yyyy-MM-dd
@shredder47
shredder47 / fatjar.xml
Created June 6, 2021 09:31
FAT JAR using MAVEN
<build>
<finalName>Project Name</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
@shredder47
shredder47 / localinstall.cmd
Created June 6, 2021 09:53
Maven Install Local JAR
mvn install:install-file -Dfile=shredder-engine-sdk.jar -DgroupId=com.shredder -DartifactId=shredder-sdk -Dversion=1.0-SNAPSHOT -Dpackaging=jar
// -Dfile = full path to the JAR file. Else put the JAR in project's root Dir and then run mvn command from there if you want to specify only the Jar file name.