Search in sources :

Example 51 with HiveConf

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

the class TestLdapUtils method testCreateCandidatePrincipalsForUserWithDomain.

@Test
public void testCreateCandidatePrincipalsForUserWithDomain() {
    HiveConf conf = new HiveConf();
    String userWithDomain = "user1@mycompany.com";
    List<String> expected = Arrays.asList(userWithDomain);
    List<String> actual = LdapUtils.createCandidatePrincipals(conf, userWithDomain);
    assertEquals(expected, actual);
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Test(org.junit.Test)

Example 52 with HiveConf

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

the class TestLdapUtils method testCreateCandidatePrincipals.

@Test
public void testCreateCandidatePrincipals() {
    HiveConf conf = new HiveConf();
    conf.setVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_BASEDN, "dc=mycompany,dc=com");
    conf.setVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_USERDNPATTERN, "cn=%s,ou=CORP1,dc=mycompany,dc=com:cn=%s,ou=CORP2,dc=mycompany,dc=com");
    List<String> expected = Arrays.asList("cn=user1,ou=CORP1,dc=mycompany,dc=com", "cn=user1,ou=CORP2,dc=mycompany,dc=com");
    List<String> actual = LdapUtils.createCandidatePrincipals(conf, "user1");
    Collections.sort(expected);
    Collections.sort(actual);
    assertEquals(expected, actual);
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Test(org.junit.Test)

Example 53 with HiveConf

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

the class BeeLineOpts method getShowHeader.

public boolean getShowHeader() {
    if (beeLine.isBeeLine()) {
        return showHeader;
    } else {
        boolean header;
        HiveConf conf = beeLine.getCommands().getHiveConf(true);
        header = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_CLI_PRINT_HEADER);
        return header;
    }
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf)

Example 54 with HiveConf

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

the class BeeLine method getPromptForCli.

String getPromptForCli() {
    String prompt;
    // read prompt configuration and substitute variables.
    HiveConf conf = getCommands().getHiveConf(true);
    prompt = conf.getVar(HiveConf.ConfVars.CLIPROMPT);
    prompt = getCommands().substituteVariables(conf, prompt);
    return prompt + getFormattedDb() + "> ";
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf)

Example 55 with HiveConf

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

the class StreamingTestUtils method newHiveConf.

public HiveConf newHiveConf(String metaStoreUri) {
    HiveConf conf = new HiveConf(this.getClass());
    conf.set("fs.raw.impl", RawFileSystem.class.getName());
    if (metaStoreUri != null) {
        conf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreUri);
    }
    conf.setBoolVar(HiveConf.ConfVars.METASTORE_EXECUTE_SET_UGI, true);
    conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
    return conf;
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf)

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