Skip to content

Instantly share code, notes, and snippets.

View hive_write.py
import json
import re
import base64
import logging
import unicodecsv as csv
import sys
import argparse
import ssl
import os
import random
View deco_demo.py
def decoratorFunction(func):
print "In Decorator Before function call"
def _fn():
try:
ret = func()
return ret
except IOError as e:
print "I/O error"
rollback()
except ValueError as e:
@utkjad
utkjad / how_to_hive_unset_table_property.txt
Created Mar 9, 2018
How to unset TBLPROPERTIES in Hive
View how_to_hive_unset_table_property.txt
-- unset a subset of the properties and some non-existed properties without if exists
ALTER TABLE testTable UNSET TBLPROPERTIES ('c', 'x', 'y', 'z');
Releavnt Link - https://github.com/apache/hive/search?utf8=%E2%9C%93&q=unset&type=
@utkjad
utkjad / how_to_kerberos.txt
Last active Oct 26, 2019
How to create renewable kerberos ticket
View how_to_kerberos.txt
1.On KDC server login as kadmin.
kadmin -p admin/admin@<realm>
2. Now create Kerberos User. If the user principal is already created, go to step 3.
add_principal -kvno 1 sample@HC1.QA
3.Modify the user principal.
modprinc -maxlife 1days -maxrenewlife 7days +allow_renewable sample
Confirm the same by running following command
get_principal ingestor
@utkjad
utkjad / connect_to_pyhive_http_mode.py
Created Dec 18, 2017
Utility function to connect to Pyhive on HTTP mode.
View connect_to_pyhive_http_mode.py
from pyhive import hive
def connect_to_pyhive():
""" Connects to Pyhive with HTTP mode
"""
conn = hive.connect(thrift_transport=add_http_mode_support())
cursor = conn.cursor()
cursor.execute("show databases")
print cursor.fetchone()
View keybase.md

Keybase proof

I hereby claim:

  • I am utkjad on github.
  • I am utkjad (https://keybase.io/utkjad) on keybase.
  • I have a public key whose fingerprint is 820F B08D B79F A371 5367 CEF0 152D D775 7ACF 6236

To claim this, I am signing this object: