ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Characters Sorting in ESQL

Post new topic  Reply to topic Goto page 1, 2  Next
 Characters Sorting in ESQL « View previous topic :: View next topic » 
Author Message
kr.danda
PostPosted: Tue Apr 15, 2014 6:36 am    Post subject: Characters Sorting in ESQL Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15



Input File Message : BLOB Message

LOLArece jrepickedi kjkkjwkejkwjejweweg
LOAjrece krepickedi kjkkjwkejkwjejwewet
OLArecei repickedin jkkjwkejkwjejwewerg
JLArecei lepickedin jkkjwkejkwjejweweel
ROLArec arepickedi kjkkjwkejkwjejwewei
TOLArec bvescontai nerdatajbrepickedikjh

Conditions :-
The Second Columns Characters is sort alphabetic order.

Flow:-
FileInput Node ----> Compute Node ----> File Output Node


Please Help me...

Thank You in Advance

Regards,
Karuna


Last edited by kr.danda on Tue Apr 15, 2014 7:26 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Tue Apr 15, 2014 6:41 am    Post subject: Re: Characters Sorting in ESQL Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

It is not really clear what you are asking for

You should first thoroughly search the forum (before asking a question / opening a new thread) !

Probably this may help you: http://www.mqseries.net/phpBB2/viewtopic.php?t=66282
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 15, 2014 7:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

you really don't want to do that in the broker. Write a file, sort the file according to that second column, ingest the sorted file...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Apr 15, 2014 8:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
you really don't want to do that in the broker. Write a file, sort the file according to that second column, ingest the sorted file...



what's wrong with calling a static java function to sort a string?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 15, 2014 8:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

mqjeff wrote:
fjb_saper wrote:
you really don't want to do that in the broker. Write a file, sort the file according to that second column, ingest the sorted file...



what's wrong with calling a static java function to sort a string?

on the nth character?
Java is not the fastest way around to sort based on a column in an array of strings....

Let's say tomorrow he wants to sort according to column 5 asc, column 2 desc, and column 9 asc.... for 2 million rows... of unknown length ?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Apr 15, 2014 8:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
mqjeff wrote:
fjb_saper wrote:
you really don't want to do that in the broker. Write a file, sort the file according to that second column, ingest the sorted file...



what's wrong with calling a static java function to sort a string?

on the nth character?
Java is not the fastest way around to sort based on a column in an array of strings....

Let's say tomorrow he wants to sort according to column 5 asc, column 2 desc, and column 9 asc.... for 2 million rows... of unknown length ?


I do not see any notion of sorting across columns. Merely of sorting the characters within a single column.
Back to top
View user's profile Send private message
kr.danda
PostPosted: Tue Apr 15, 2014 11:05 am    Post subject: Characters Sorting in ESQL Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15

Hi Every One..

I don't want sort in Java...I Required ESQL code...Could Please Help me...


Regards,
karuna
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Tue Apr 15, 2014 11:18 am    Post subject: Re: Characters Sorting in ESQL Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Use "quicksort"
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kr.danda
PostPosted: Tue Apr 15, 2014 6:44 pm    Post subject: Characters Sorting in ESQL Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15

Could Please give the Brief Explanation for Character sorting in ESQL
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Tue Apr 15, 2014 9:19 pm    Post subject: Re: Characters Sorting in ESQL Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

http://www.mqseries.net/phpBB2/viewtopic.php?t=53074
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kr.danda
PostPosted: Wed Apr 16, 2014 7:06 am    Post subject: Characters Sorting in ESQL Reply with quote

Novice

Joined: 08 Apr 2014
Posts: 15

Sample Input Message :-
Here Given the Four Characters...
str1- J
str2- A
str3- C
str4- D

How can Take Implementation logic for Sorting Character.
Please Guide Me.....

Output Specification:-
A
C
D
J

Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Apr 16, 2014 9:12 am    Post subject: Re: Characters Sorting in ESQL Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

kr.danda wrote:
Sample Input Message :-
Here Given the Four Characters...
str1- J
str2- A
str3- C
str4- D

How can Take Implementation logic for Sorting Character.
Please Guide Me.....

Output Specification:-
A
C
D
J



So what have you tried: bubble sort, quadratic sort etc...?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Wed Apr 16, 2014 10:11 am    Post subject: Re: Characters Sorting in ESQL Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

fjb_saper wrote:
So what have you tried: bubble sort, quadratic sort etc...?


quicksort is fastest and YOU SHOULD USE IT
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Apr 17, 2014 2:09 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you really must use ESQL for this, then mqsiuser has provided you with the algorithm.
Personally, I would call out to a Java method from ESQL.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Apr 17, 2014 2:40 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

kimbert wrote:
If you really must use ESQL for this, then mqsiuser has provided you with the algorithm.

I guess this quicksort is okay... mqjeff, fjb and others don't use it: It is nlogn and uses detach & attach (but it is still fine from my point of view)

Can you use {} to sort !?

kimbert wrote:
Personally, I would call out to a Java method from ESQL.

You can't change the underlying datastructure in ESQL: It's a HashMap.

In Java you can (I am not sure about Broker's Java). You could use a TreeMap and you could sort by inserting elements into it in logn (ending up with nlogn also)

"Calling into Java": You have to implement the Comparable Interface (or make sure it is implemented as you want it to be) ...

Anybody done that (in Broker) and wants to give some hints?
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Characters Sorting in ESQL
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.