Friday, November 16, 2018

How to write an example MapR Drill JDBC code which connects to a MapR-Drill Cluster with MapRSASL authentication

Goal:

How to write an example MapR Drill JDBC code which connects to a MapR-Drill Cluster with MapRSASL authentication.
The reason why we are using Simba Drill JDBC Driver instead of open source JDBC Driver is:
The open-source JDBC driver is not tested on the MapR Converged Data Platform. The driver supports Kerberos and Plain authentication mechanisms, but does not support the MapR-SASL authentication mechanism. 

Env:

Drill 1.14 using MapRSASL authentication
MapR 6.1 secure Cluster
Simba Drill JDBC 1.6.0

Solution:

1. Download example JAVA code

https://github.com/viadea/MapRDrillJDBCExample
git clone git@github.com:viadea/MapRDrillJDBCExample.git

2. Compile

mvn clean package
The compiled jar is here:
./target/MapRDrillJDBCExample-1.0.jar

3. Copy the jar dependencies and remove possible jar conflict

mkdir drilljars
cp /opt/mapr/drill/drill-1.14.0/jars/*.jar ./drilljars/
cp /opt/mapr/drill/drill-1.14.0/jars/3rdparty/*.jar ./drilljars/
cp /opt/mapr/drill/drill-1.14.0/jars/classb/reflections-0.9.10.jar ./drilljars/
cp /opt/mapr/drill/drill-1.14.0/jars/classb/javax.servlet-api-3.1.0.jar ./drilljars/
rm ./drilljars/drill-jdbc-1.14.0-mapr-SNAPSHOT.jar

mkdir maprjars
cp /opt/mapr/lib/*.jar ./maprjars/
rm ./maprjars/slf4j-log4j12-1.7.12.jar

4. Download Simba Drill JDBC Driver

Please always follow below documentation for the correct version of the driver:
https://mapr.com/docs/home/Drill/drill_jdbc_connector.html
wget https://package.mapr.com/tools/MapR-JDBC/MapR_Drill/MapRDrill_jdbc_v1.6.0.1001/MapRDrillJDBC-1.6.0.1001.zip
unzip MapRDrillJDBC-1.6.0.1001.zip
cd MapRDrillJDBC41-1.6.0.1001
unzip MapRDrillJDBC41-1.6.0.1001.zip

5. Run the program

java -cp ./MapRDrillJDBC41-1.6.0.1001/DrillJDBC41.jar:./drilljars/*:./target/MapRDrillJDBCExample-1.0.jar:./maprjars/* openkb.drill.MapRDrillJDBCExample
This program will run "select hostname from sys.drillbits" and display the results. For example:
hostname: v1.poc.com
hostname: v4.poc.com
hostname: v3.poc.com
hostname: v2.poc.com


24 comments:

  1. Attend The Machine Learning Training in Bangalore From ExcelR. Practical Machine Learning Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning Training in Bangalore.
    ExcelR Machine Learning Training in Bangalore

    ReplyDelete
  2. Attend The PMP Certification in Abu Dhabi From ExcelR. Practical PMP Certification in Abu Dhabi Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The PMP Certification in Abu Dhabi.
    ExcelR PMP Certification in Abu Dhabi

    ReplyDelete
  3. Cool stuff you have and you keep overhaul every one of us
    data science course in mumbai

    ReplyDelete
  4. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
    data science course in mumbai

    ReplyDelete
  5. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!
    data analytics courses

    ReplyDelete
  6. At the point when you go to buy your cleaning instruments you have to ensure that the device will work for your drains. There would no detect in getting an apparatus that has an arriving at limit of 12 ft. in the event that you have a canal that is 14 ft. high. broom, dustpan and brush

    ReplyDelete
  7. This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,

    ReplyDelete
  8. Drill machines are most likely the primary mechanical gadget created with the standard of pivoting an instrument to make openings. https://www.reviewfantasy.com/best-drilling-machines-in-india.html

    ReplyDelete
  9. Write My Paper for Me This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs…

    ReplyDelete
  10. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... write my essay

    ReplyDelete
  11. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. essay writing service

    ReplyDelete
  12. Hi there! Nice stuff, do keep me posted when you post again something like this! how to make A BOW DRILL

    ReplyDelete
  13. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data science Interview Questions
    Data Science Course

    ReplyDelete
  14. Write My Essay Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our.

    ReplyDelete
  15. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
    data analytics course in Bangalore

    ReplyDelete
  16. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. podiatry drill

    ReplyDelete
  17. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete
  18. This was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself.. buy likes on instagram paypal

    ReplyDelete
  19. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work footcare drill

    ReplyDelete
  20. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  21. Attend The Data Analyst Course From ExcelR. Practical Data Analyst Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analyst Course.
    Data Analyst Course

    ReplyDelete
  22. Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

    Data Science In Banglore With Placements
    Data Science Course In Bangalore
    Data Science Training In Bangalore
    Best Data Science Courses In Bangalore
    Data Science Institute In Bangalore

    Thank you..

    ReplyDelete

Popular Posts