Reg : Group By Clause

Thursday, 28 November 2013 · 2 messages
C
ChandraSekhar28 Nov 2013 11:07 #
Dear Team , I am following the below steps to execute my XQuery 1) I am Created collection with the MyFile.xml 2) I am running the query which is in attached file(query.txt) on the above collection 3) I am Grouping the C4 element for Grouping 4)I am running this query in java Java code : new XQuery(query).execute(context,fileoutstream); Query running properly when I am not using the group by clause Problem : If I use the group by ,exception is coming like out of main memory,can you please tell me Is their any alternate to reduce the memory when using group by Thanks & Regards Chandra Sekhar
-- This message is for the intended recipient only. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of the information is strictly prohibited. __
CG
Christian Grün28 Nov 2013 11:20 #
Hi Chandra, the following query runs fine on my machine, even with 64mb assigned to Java:
<DOCUMENT>{
  for $data in collection("MyFile")//R
  let $grpByValue := data($data/C4)
  group by $grpByValue
  return <R>
    <column1> { distinct-values($data/C7) }</column1>
    <column2> { sum($data/C7) }</column2>
    <column3> { $grpByValue }</column3>
    <GrandTotalGroupBy>1</GrandTotalGroupBy>
  </R>
}</DOCUMENT>
Did you already try to assign more memory to your JVM via the -Xmx flag? Christian
Quoted text · ChandraSekhar · 34 lines
On Thu, Nov 28, 2013 at 11:07 AM, ChandraSekhar <chandrasekhar.r at intense.in> wrote: > > Dear Team , > > I am following the below steps to execute my XQuery > 1) I am Created collection with the MyFile.xml > 2) I am running the query which is in attached file(query.txt) on the above collection > 3) I am Grouping the C4 element for Grouping > 4)I am running this query in java > > Java code : new XQuery(query).execute(context,fileoutstream); > > Query running properly when I am not using the group by clause > > Problem : If I use the group by ,exception is coming like out of main memory,can you please tell me Is their any alternate to reduce the memory when using group by > > > > Thanks & Regards > Chandra Sekhar > > -- > This message is for the intended recipient only. If you are not the > intended recipient you are notified that disclosing, copying, > distributing or taking any action in reliance on the contents of the > information is strictly prohibited. > __ > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery