@Test
  public void testBeelineMultiHiveVariable() throws Throwable {
    List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL());
    argList.add("--hivevar");
    argList.add("TABLE_NAME=dummy2");

    argList.add("--hiveconf");
    argList.add("COLUMN_NAME=d");

    argList.add("--hivevar");
    argList.add("COMMAND=create");
    argList.add("--hivevar");
    argList.add("OBJECT=table");

    argList.add("--hiveconf");
    argList.add("COLUMN_TYPE=int");

    final String SCRIPT_TEXT = "${COMMAND} ${OBJECT} ${TABLE_NAME} "
        + "(${hiveconf:COLUMN_NAME} ${hiveconf:COLUMN_TYPE});"
        + "\nshow tables;\n drop ${OBJECT} ${TABLE_NAME};\n";
    final String EXPECTED_PATTERN = "dummy2";
    testScriptFile(SCRIPT_TEXT, argList, EXPECTED_PATTERN, true);
  }
Test Beeline -hivevar option. User can specify --hivevar name=value on Beeline command line.
This test defines multiple variables using repeated --hivevar or --hiveconf flags.
@throws Throwable
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java