spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhan Zhang <zzh...@hortonworks.com>
Subject Re: TreeNodeException: Unresolved attributes
Date Thu, 05 Mar 2015 02:21:58 GMT
Which spark version did you use? I tried spark-1.2.1 and didn’t meet this problem.

scala> val m = hiveContext.sql(" select * from  testtable where value like '%Restaurant%'")
15/03/05 02:02:30 INFO ParseDriver: Parsing command: select * from  testtable where value
like '%Restaurant%'
15/03/05 02:02:30 INFO ParseDriver: Parse Completed
15/03/05 02:02:30 INFO MemoryStore: ensureFreeSpace(462299) called with curMem=1087888, maxMem=280248975
15/03/05 02:02:30 INFO MemoryStore: Block broadcast_2 stored as values in memory (estimated
size 451.5 KB, free 265.8 MB)
15/03/05 02:02:30 INFO MemoryStore: ensureFreeSpace(81645) called with curMem=1550187, maxMem=280248975
15/03/05 02:02:30 INFO MemoryStore: Block broadcast_2_piece0 stored as bytes in memory (estimated
size 79.7 KB, free 265.7 MB)
15/03/05 02:02:30 INFO BlockManagerInfo: Added broadcast_2_piece0 in memory on c6402.ambari.apache.org<http://c6402.ambari.apache.org>:33696
(size: 79.7 KB, free: 267.0 MB)
15/03/05 02:02:30 INFO BlockManagerMaster: Updated info of block broadcast_2_piece0
15/03/05 02:02:30 INFO DefaultExecutionContext: Created broadcast 2 from broadcast at TableReader.scala:68
m: org.apache.spark.sql.SchemaRDD =
SchemaRDD[3] at RDD at SchemaRDD.scala:108
== Query Plan ==
== Physical Plan ==
Filter Contains(value#5, Restaurant)
 HiveTableScan [key#4,value#5], (MetastoreRelation default, testtable, None), None

scala>


Thanks.

Zhan Zhang

On Mar 4, 2015, at 9:09 AM, Anusha Shamanur <anushasb11@gmail.com<mailto:anushasb11@gmail.com>>
wrote:

I tried. I still get the same error.

15/03/04 09:01:50 INFO parse.ParseDriver: Parsing command: select * from TableName where value
like '%Restaurant%'

15/03/04 09:01:50 INFO parse.ParseDriver: Parse Completed.

15/03/04 09:01:50 INFO metastore.HiveMetaStore: 0: get_table : db=default tbl=TableName

15/03/04 09:01:50 INFO HiveMetaStore.audit: ugi=as7339 ip=unknown-ip-addr cmd=get_table :
db=default tbl=TableName
results: org.apache.spark.sql.SchemaRDD =

SchemaRDD[86] at RDD at SchemaRDD.scala:108
== Query Plan ==

== Physical Plan ==

org.apache.spark.sql.catalyst.errors.package$TreeNodeException: Unresolved attributes: *,
tree:

'Project [*]

'Filter ('value LIKE Restaurant)
  MetastoreRelation default, TableName, None



On Wed, Mar 4, 2015 at 5:39 AM, Arush Kharbanda <arush@sigmoidanalytics.com<mailto:arush@sigmoidanalytics.com>>
wrote:
Why don't you formulate a string before you pass it to the hql function (appending strings),
and hql function is deprecated. You should use sql.

http://spark.apache.org/docs/1.1.0/api/scala/index.html#org.apache.spark.sql.hive.HiveContext

On Wed, Mar 4, 2015 at 6:15 AM, Anusha Shamanur <anushasb11@gmail.com<mailto:anushasb11@gmail.com>>
wrote:
Hi,

I am trying to run a simple select query on a table.

val restaurants=hiveCtx.hql("select * from TableName where column like '%SomeString%' ")
This gives an error as below:
org.apache.spark.sql.catalyst.errors.package$TreeNodeException: Unresolved attributes: *,
tree:

How do I solve this?


--
Regards,
Anusha



--

[Sigmoid Analytics]<http://htmlsig.com/www.sigmoidanalytics.com>

Arush Kharbanda || Technical Teamlead

arush@sigmoidanalytics.com<mailto:arush@sigmoidanalytics.com> || www.sigmoidanalytics.com<http://www.sigmoidanalytics.com/>



--
Regards,
Anusha


Mime
View raw message