Wednesday, 5 October 2016

How to generate large amount of sample data with simple techniques

Download the Required jar file from this link.


Generate Sample Users using Below Command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateUsers

usage: help

-d,--delimiter Field Delimiter, bydefault is json format
-f,--file output file path
-h,--help Show this help and quit
-n,--numberOfUsers number of users
-s,--startNumber starting number of userid, bydefault is 1



Example1 : To Generate json data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateUsers \
-f /tmp/users.json \
-n 10 \
-s 1


Example2 : To Generate csv data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateUsers \
-f /tmp/users.csv \
-d ',' \
-n 10 \
-s 1


Example3 : To Generate tsv data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateUsers \
-f /tmp/users.tsv \
-d '\t' \
-n 10 \
-s 1


Example4 : To Generate any delimiter data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateUsers \
-f /tmp/users.txt \
-d '#' \
-n 10 \
-s 1





Generate Sample Product Log using Below Command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateProductLog

usage: help

-d,--delimiter Field Delimiter, bydefault is json format
-f,--file output file path
-h,--help Show this help and quit
-l,--numberOfLogs number of logs
-n,--numberOfUsers number of users




Example1 : To Generate json data, use below command



java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateProductLog \
-f /tmp/productlog.json \
-n 10 \
-l 20


Example2 : To Generate csv data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateProductLog \
-f /tmp/productlog.csv \
-d ',' \
-n 10 \
-l 20


Example3 : To Generate tsv data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateProductLog \
-f /tmp/productlog.tsv \
-d '\t' \
-n 10 \
-l 20


Example4 : To Generate any delimiter data, use below command

java -cp bigdata-examples-0.0.1-SNAPSHOT-dependency-jars.jar \
com.orienit.kalyan.examples.GenerateProductLog \
-f /tmp/productlog.txt \
-d '#' \
-n 10 \
-l 20




Share this article with your friends.

1 comment :

Related Posts Plugin for WordPress, Blogger...