core/src/test/java/org/apache/hop/core/sql/SqlTest.java
@Test
  public void testSql09() throws Exception {
    IRowMeta rowMeta = generateServiceRowMeta();

    String sqlString = "SELECT Category, Country, products_sold, sales_amount FROM Kettle.Service";

    Sql sql = new Sql(ThinUtil.stripNewlines(sqlString));

    assertEquals("Kettle", sql.getNamespace());
    assertEquals("Service", sql.getServiceName());
    sql.parse(rowMeta);

    assertFalse(sql.getSelectFields().isDistinct());
    List<SqlField> selectFields = sql.getSelectFields().getFields();
    assertEquals(4, selectFields.size());
    assertEquals("Category", selectFields.get(0).getField());
    assertEquals("Country", selectFields.get(1).getField());
    assertEquals("products_sold", selectFields.get(2).getField());
    assertEquals("sales_amount", selectFields.get(3).getField());
  }
/**
   * Tests schema.table format
   *
   * @throws Exception
   */
Tests schema.table format
@throws Exception
Tests schema . table format @throws Exception
@Test
  public void testSql09() throws Exception {
    IRowMeta rowMeta = generateServiceRowMeta();
    String sqlString = "SELECT Category, Country, products_sold, sales_amount FROM Kettle.Service";
    Sql sql = new Sql(ThinUtil.stripNewlines(sqlString));
    assertEquals("Kettle", sql.getNamespace());
    assertEquals("Service", sql.getServiceName());
    sql.parse(rowMeta);
    assertFalse(sql.getSelectFields().isDistinct());
    List<SqlField> selectFields = sql.getSelectFields().getFields();
    assertEquals(4, selectFields.size());
    assertEquals("Category", selectFields.get(0).getField());
    assertEquals("Country", selectFields.get(1).getField());
    assertEquals("products_sold", selectFields.get(2).getField());
    assertEquals("sales_amount", selectFields.get(3).getField());
  }
@ Test public void testSql09 ( ) throws Exception { IRowMeta rowMeta = generateServiceRowMeta ( ) ; String sqlString = "SELECT Category, Country, products_sold, sales_amount FROM Kettle.Service" ; Sql sql = new Sql ( ThinUtil . stripNewlines ( sqlString ) ) ; assertEquals ( "Kettle" , sql . getNamespace ( ) ) ; assertEquals ( "Service" , sql . getServiceName ( ) ) ; sql . parse ( rowMeta ) ; assertFalse ( sql . getSelectFields ( ) . isDistinct ( ) ) ; List < SqlField > selectFields = sql . getSelectFields ( ) . getFields ( ) ; assertEquals ( 4 , selectFields . size ( ) ) ; assertEquals ( "Category" , selectFields . get ( 0 ) . getField ( ) ) ; assertEquals ( "Country" , selectFields . get ( 1 ) . getField ( ) ) ; assertEquals ( "products_sold" , selectFields . get ( 2 ) . getField ( ) ) ; assertEquals ( "sales_amount" , selectFields . get ( 3 ) . getField ( ) ) ; }
Tests schema.table format
 @throws Exception
Tests schema . table format @throws Exception