Home Forums Hive / HCatalog problem with sql server openquery to hive

This topic contains 2 replies, has 2 voices, and was last updated by  Guitao Ding 7 months, 3 weeks ago.

  • Creator
    Topic
  • #33356

    Guitao Ding
    Member

    I’m using SQL Server and created a linked server to do queries using hive.
    But now i found when i use openquery(hive, ‘query sql’), the query run twice on the hive side.
    I’m using Hortonworks Hive ODBC Driver 1.2 (64 bit).
    I’m not sure if the first query is to get the metadata of the query result. If so, too silly….
    What should I do to avoid this? This is really annoying for taking much longer time to get the result.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #33973

    Guitao Ding
    Member

    Hi Abdelrahman,

    Sorry for my late reply.

    Actually it was not dependent on the query i ran. For example:

    The following query runs twice. I can see in the hive server log. The second and absolutely same job was started immediately after the first job finished. It takes about 40 seconds.
    `select * from openquery(hive, ‘select column1, column2 from table_name limit 200′)`

    Strangely, when I run the same query immediately after the first query finished in SQL Server, the query
    runs only once on the hive side.

    But when i run the same query long time after the first query finished in SQL Server, the query runs twice again on the hive side.

    Guitao

    Collapse
    #33702

    abdelrahman
    Moderator

    Hi Guitao,

    Can you provide more info about the query which you have ran?

    Thanks
    -Rahman

    Collapse
Viewing 2 replies - 1 through 2 (of 2 total)