String createTableDefinition(HplsqlParser.Create_table_definitionContext ctx, Token last) { 
    StringBuilder sql = new StringBuilder();
    HplsqlParser.Create_table_columnsContext colCtx = ctx.create_table_columns();
    if (colCtx != null) {
      int cnt = colCtx.create_table_columns_item().size();
      for (int i = 0; i < cnt; i++) {
        HplsqlParser.Create_table_columns_itemContext col = colCtx.create_table_columns_item(i);
        if (col.create_table_column_cons() != null) {
          last = col.getStop();
          continue;
        }
        exec.append(sql, evalPop(col.column_name()).toString(), last, col.column_name().getStop());
        exec.append(sql, exec.evalPop(col.dtype(), col.dtype_len()), col.column_name().getStop(), col.dtype().getStart());
        last = col.getStop();
      }
      exec.append(sql, ctx.T_CLOSE_P().getText(), last, ctx.T_CLOSE_P().getSymbol());
    }
    else if (ctx.T_LIKE() != null) {
      sql.append(" ").append(ctx.T_LIKE().getText()).append(" ").append(evalPop(ctx.table_name()));
    }
    // CREATE TABLE AS SELECT statement
    else {
      exec.append(sql, evalPop(ctx.select_stmt()).toString(), last, ctx.select_stmt().getStart());
      if (ctx.T_CLOSE_P() != null) {
        exec.append(sql, ctx.T_CLOSE_P().getText(), ctx.select_stmt().stop, ctx.T_CLOSE_P().getSymbol());
      }
    }
    HplsqlParser.Create_table_optionsContext options = ctx.create_table_options();
    if (options != null) {
      String opt = evalPop(options).toString();
      if (opt != null) {
        sql.append(" " + opt);
      }
    }
    return sql.toString(); 
  }
Get CREATE TABLE definition (columns or query)
hplsql/src/main/java/org/apache/hive/hplsql/Stmt.java