Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    SELECT page_views.*
    FROM page_views JOIN dim_users
      ON (page_views.user_id = dim_users.id AND page_views.date >= '2008-03-01' AND page_views.date <= '2008-03-31')

...

The first argument specifies the offset of the first row to return (as of Hive 2.0.0) and the second specifies the maximum number of rows to return.

A When a single argument is given, it stands for the maximum number of rows and the offset defaults to 0.

 

Limit indicates the number of rows to be returned. The rows returned are chosen at random. The following query returns 5 rows from t1 at random.arbitrary customers

Code Block
SELECT * FROM t1customers LIMIT 5

...


The following query returns the

...

first 5 customers to be created

Code Block

...

SELECT * FROM customers ORDER BY create_date LIMIT 5

 

The following query returns the  3rd to the 7th customers to be created

Code Block
SELECT * FROM 

...

customers 

...

ORDER BY 

...

create_date 

...

LIMIT 2,5


REGEX Column Specification

...