IRC log for #storm on 20080910

00:01.05*** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net)
02:16.36*** join/#storm kov (n=kov@debian/developer/kov)
03:56.14*** join/#storm dobee (n=dobee@lsfw01.lovelysystems.com)
04:38.59*** join/#storm jukart (n=jukart@85-124-221-45.static.xdsl-line.inode.at)
05:21.36*** join/#storm jukart (n=jukart@lsfw01.lovelysystems.com)
05:37.50jmlcan you add extra clauses to the object returned by find()?
05:37.57jmllooks in the code
05:41.26jameshjml: not at present.
05:41.32jameshpatches welcome :)
05:41.57jmlis inclined to act on that.
05:42.21jameshI guess having a ResultSet.find() wouldn't be too difficult
05:42.23jmljamesh: do you know if there are any obstacles beside the will to act?
05:42.31jameshespecially if it bailed out on difficult result sets
05:42.55jmli.e. raise an exception?
05:43.16jameshjml: as a new feature, raising FeatureError() for unsupported cases should be fine
05:43.39jameshonce you start involving set expressions, grouping, etc, things get difficult
05:44.15jameshwe can remove some of the FeatureErrors as more statements are handled
09:06.42*** join/#storm goschtl (n=goschtl@p5B0BBB4B.dip.t-dialin.net)
11:32.56*** join/#storm kov (n=kov@debian/developer/kov)
11:37.24*** join/#storm jukart (n=jukart@lsfw01.lovelysystems.com)
12:04.42*** join/#storm kov (n=kov@debian/developer/kov)
12:55.48*** join/#storm jkakar (n=jkakar@modemcable178.77-70-69.static.videotron.ca)
13:22.11*** join/#storm niemeyer (n=niemeyer@modemcable178.77-70-69.static.videotron.ca)
13:37.58*** join/#storm andrea-bs (n=andrea@ubuntu/member/beeseek.developer.andrea-bs)
13:42.34*** join/#storm jjrojo (n=jjrojo@118.Red-83-53-106.dynamicIP.rima-tde.net)
14:01.29*** join/#storm oubiwann (n=oubiwann@97-119-6-118.omah.qwest.net)
14:03.36*** join/#storm jjrojo (n=jjrojo@118.Red-83-53-106.dynamicIP.rima-tde.net)
14:16.39*** join/#storm thiag0 (n=thiagoc@unaffiliated/thiag0)
14:20.23thiag0hi... how I can make a 'right join' in storm?
14:21.05thervehello
14:21.11thervethiag0: did you look at the tutorial
14:21.30thervehttps://storm.canonical.com/Tutorial#Joins explains joins, you can use RightJoin instead of Join afaik
14:29.20thiag0yes, I read it... but I'm trying with the implicit join
14:30.16thervewell, it's explained as well
14:30.52thiag0yes, sorry :)
14:35.41thiag0therve: RightJoin is only in the trunk, right?
14:35.59therveno
14:36.14therveit should at least be in the .13 release, probably .12 as well
14:36.27thiag0ok
14:36.33thiag0tks
14:36.37therveno problem
14:51.56thiag0therve: i'm using python 2.4, storm .12, don't have RightJoin :(
14:54.21thervewell, upgrade to .13
16:04.02thiag0therve: .13 isn't for the py 2.5 only?
16:04.22thervenope
16:05.01thervewhat give you this impression?
16:26.58thiag0therve: I installed storm with setuptools
16:27.20thervethiag0: okay
16:27.22thiag0the version .12 was installed
16:27.26thervewhen?
16:27.41thiag0some days ago
16:29.04thervethiag0: okay, then try again :)
16:29.17therve0.13 was release like 10 days ago
16:29.30thiag0http://pypi.python.org/pypi/storm
16:29.34therveI just tried and I got .13
16:29.38thiag0okay, i will try
16:31.49thiag0therve: now is .13 :)
16:34.14thervecool :)
16:35.00thiag0therve: >>> from storm.locals import RightJoin
16:35.08thiag0ImportError: cannot import name RightJoin
16:35.41therveyeah, it's in storm.expr
16:36.03thiag0therve: oO
16:36.04thiag0sorry
16:36.06*** join/#storm fcorrea (n=fcorrea@c953f7fd.virtua.com.br)
16:36.06thiag0:)
16:36.12therveit may worth adding it to storm.locals, but it's pretty unusual, so maybe not
16:36.42thiag0yeah, works fine
16:37.34*** join/#storm Exaurdon (n=IceChat7@12.191.193.40)
16:40.08ExaurdonCould anyone give me an example of how to join against a Subquery (If it is possible)? I.e. the MySql syntax would be somehting like "SELECT foo.* FROM (SELECT * from bar) AS foo;" (This is a meaningless query that would simply return the contents of table 'bar')
16:41.45jkakarExaurdon: You can use the Select expression to build up a subquery.
16:41.50ExaurdonThe storm examples I find on using subqueries seem to all be oriented around instantiating a 'Select' object, and then using the is_in method within a where clause. Does Storm support joining against subqueries?
16:42.03Exaurdon*nod* I think I have figured out how to build the Select object.
16:42.24ExaurdonCan that be used in a join expression somehow?
16:44.32jkakarExaurdon: Here's a crappy example: http://paste.ubuntu.com/45419/
16:44.44jkakarExaurdon: Ah, joining.  Hmm.
16:44.49jkakarExaurdon: I'm not really sure.
16:45.18jkakarExaurdon: Have you tried using a Select with Join?
16:45.36ExaurdonI'm just trying to put soemthing like that together now
16:45.44jkakarCool.
16:45.55Exaurdonbut how do I refer to teh columns in the 'Slect' expression in my join clause?
16:46.46jkakarHmm.  I
16:46.50jkakar'm not sure. :(
16:47.23ExaurdonI have a select object that should have a couple columns, but I am getting syntax errors trying to refer to those columns in my join cluase....
16:48.33ExaurdonWhat I am relaly trying to accomplish, is to join a table (e.g. customer) against another table (e.g. purchase). But I want to only join the customer against their most recent purchase (I.e. Max(purchase.date))
16:49.01ExaurdonSo the result of the query should be tuples of customers, and their most recent purchases.
16:53.22ExaurdonSo I am trying to do a subselect for purchase.customer_id, Max(date) as date (with a group_by on customer_id). Then I want to join that query back against the purchases table, joining on purchase.customer_id = subselect.customer_id, and purchase.date = subselect.date)
16:59.30Exaurdonhmm, making a little progress, it looks like I might be able to refer to the columsn of the Select object through its columns member....
17:00.16ExaurdonI.e. if I have a select object 'ss' I think I can use ss.columns[0] as an expression to refer to its value?
17:01.50jkakarHmm, cool.
17:12.56ExaurdonOk, I think that is all working
17:13.00Exaurdona couple quicks though
17:13.21ExaurdonI had to put Aliases on all of the columns in the subselect
17:13.57Exaurdonotherwise referencing colmun[0] would result in a reference to the 'original' column, no the one from the subselect
17:17.01ExaurdonI.e. if I did foo = Select(Customer.id); and then tried somehting like ... LeftJoin(Alias(foo, "foo"), foo.column[0] = bar.id) ... the resultant SQL would be: ... Left Join (SELECT Customer.id FROM Customer) as foo on Customer.id = Bar.id ...
17:17.43Exaurdonwhen it needed to be ... Left Join (SELECT Customer.id as id FROM Customer) as foo on foo.id = Bar.id ...
17:18.23ExaurdonAnyway, I guess the ability to join a subquery exists, but looks to be a bit of a hack.....
17:21.20radixhmm
17:21.32radixI think there's a parameter somewhere that solves the problem where the column would refer to the original column instead of the inner one
17:22.06radixah yes
17:22.28radixExaurdon: you may be able to avoid the column confusion by passing tables= explicitly in the subquery
17:23.04Exaurdonso passing in a list of the tables as a param to the Select constructor?
17:25.21ExaurdonHmm, I just tried that, but it didn't seem to make a difference.
17:26.12ExaurdonThe subquery is always built correclty, with or without the tables param being populated.
17:27.42ExaurdonHowever, if I want to refer to one fo the columsn of the subquery in the 'ON' portion of a Join, I am referencing them using ss.columns[0], and that reference comes out as the 'original' table name unless I put an alias inside the subquery.... (I hope this sentance makes sense)
18:43.18*** join/#storm dobee (n=dobee@85-124-200-100.static.xdsl-line.inode.at)
20:48.32*** join/#storm oubiwann (n=oubiwann@97-119-6-118.omah.qwest.net)
21:55.01*** join/#storm jkakar (n=jkakar@modemcable178.77-70-69.static.videotron.ca)

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.