Search in sources :

Example 56 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class HCatTable method getConf.

HiveConf getConf() {
    if (conf == null) {
        LOG.warn("Conf hasn't been set yet. Using defaults.");
        conf = new HiveConf();
    }
    return conf;
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf)

Example 57 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestClientSideAuthorizationProvider method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    int port = MetaStoreUtils.findFreePort();
    // Turn off metastore-side authorization
    System.setProperty(HiveConf.ConfVars.METASTORE_PRE_EVENT_LISTENERS.varname, "");
    MetaStoreUtils.startMetaStore(port, ShimLoader.getHadoopThriftAuthBridge());
    clientHiveConf = new HiveConf(this.getClass());
    // Turn on client-side authorization
    clientHiveConf.setBoolVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
    clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER.varname, getAuthorizationProvider());
    clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER.varname, InjectableDummyAuthenticator.class.getName());
    clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_TABLE_OWNER_GRANTS.varname, "");
    clientHiveConf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
    clientHiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + port);
    clientHiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTCONNECTIONRETRIES, 3);
    clientHiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    clientHiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
    clientHiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
    ugi = Utils.getUGI();
    SessionState.start(new CliSessionState(clientHiveConf));
    msc = new HiveMetaStoreClient(clientHiveConf);
    driver = new Driver(clientHiveConf);
}
Also used : HiveMetaStoreClient(org.apache.hadoop.hive.metastore.HiveMetaStoreClient) Driver(org.apache.hadoop.hive.ql.Driver) HiveConf(org.apache.hadoop.hive.conf.HiveConf) CliSessionState(org.apache.hadoop.hive.cli.CliSessionState)

Example 58 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestFolderPermissions method setup.

@BeforeClass
public static void setup() throws Exception {
    conf = new HiveConf(TestFolderPermissions.class);
    conf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
    baseSetup();
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) BeforeClass(org.junit.BeforeClass)

Example 59 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestServerSpecificConfig method testSystemPropertyPrecedence.

/**
   * Ensure that system properties still get precedence. Config params set as
   * -hiveconf on commandline get set as system properties They should have the
   * final say
   */
@Test
public void testSystemPropertyPrecedence() {
    // Using property defined in HiveConf.ConfVars to test System property
    // overriding
    final String OVERRIDE_KEY = "hive.conf.restricted.list";
    try {
        HiveConf.setHiveSiteLocation(oldDefaultHiveSite);
        System.setProperty(OVERRIDE_KEY, "from.sysprop");
        HiveConf conf = new HiveConf();
        // ensure metatore site.xml does not get to override this
        assertEquals("from.sysprop", conf.get(OVERRIDE_KEY));
        // get HS2 site.xml loaded
        new HiveServer2();
        conf = new HiveConf();
        assertTrue(HiveConf.isLoadHiveServer2Config());
        // ensure hiveserver2 site.xml does not get to override this
        assertEquals("from.sysprop", conf.get(OVERRIDE_KEY));
    } finally {
        System.getProperties().remove(OVERRIDE_KEY);
    }
}
Also used : HiveServer2(org.apache.hive.service.server.HiveServer2) HiveConf(org.apache.hadoop.hive.conf.HiveConf) Test(org.junit.Test)

Example 60 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestCreateUdfEntities method setUp.

@Before
public void setUp() throws Exception {
    HiveConf conf = new HiveConf(Driver.class);
    SessionState.start(conf);
    driver = new Driver(conf);
    driver.init();
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Before(org.junit.Before)

Aggregations

HiveConf (org.apache.hadoop.hive.conf.HiveConf)404 BeforeClass (org.junit.BeforeClass)73 Test (org.junit.Test)66 Path (org.apache.hadoop.fs.Path)54 Before (org.junit.Before)50 Driver (org.apache.hadoop.hive.ql.Driver)46 CliSessionState (org.apache.hadoop.hive.cli.CliSessionState)44 IOException (java.io.IOException)39 ArrayList (java.util.ArrayList)37 File (java.io.File)31 HashMap (java.util.HashMap)26 FileSystem (org.apache.hadoop.fs.FileSystem)26 SessionState (org.apache.hadoop.hive.ql.session.SessionState)22 LinkedHashMap (java.util.LinkedHashMap)17 List (java.util.List)16 HiveException (org.apache.hadoop.hive.ql.metadata.HiveException)15 MiniHS2 (org.apache.hive.jdbc.miniHS2.MiniHS2)14 Map (java.util.Map)12 HiveMetaStoreClient (org.apache.hadoop.hive.metastore.HiveMetaStoreClient)12 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)12