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.50 | jml | can you add extra clauses to the object returned by find()? |
05:37.57 | jml | looks in the code |
05:41.26 | jamesh | jml: not at present. |
05:41.32 | jamesh | patches welcome :) |
05:41.57 | jml | is inclined to act on that. |
05:42.21 | jamesh | I guess having a ResultSet.find() wouldn't be too difficult |
05:42.23 | jml | jamesh: do you know if there are any obstacles beside the will to act? |
05:42.31 | jamesh | especially if it bailed out on difficult result sets |
05:42.55 | jml | i.e. raise an exception? |
05:43.16 | jamesh | jml: as a new feature, raising FeatureError() for unsupported cases should be fine |
05:43.39 | jamesh | once you start involving set expressions, grouping, etc, things get difficult |
05:44.15 | jamesh | we 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.23 | thiag0 | hi... how I can make a 'right join' in storm? |
14:21.05 | therve | hello |
14:21.11 | therve | thiag0: did you look at the tutorial |
14:21.30 | therve | https://storm.canonical.com/Tutorial#Joins explains joins, you can use RightJoin instead of Join afaik |
14:29.20 | thiag0 | yes, I read it... but I'm trying with the implicit join |
14:30.16 | therve | well, it's explained as well |
14:30.52 | thiag0 | yes, sorry :) |
14:35.41 | thiag0 | therve: RightJoin is only in the trunk, right? |
14:35.59 | therve | no |
14:36.14 | therve | it should at least be in the .13 release, probably .12 as well |
14:36.27 | thiag0 | ok |
14:36.33 | thiag0 | tks |
14:36.37 | therve | no problem |
14:51.56 | thiag0 | therve: i'm using python 2.4, storm .12, don't have RightJoin :( |
14:54.21 | therve | well, upgrade to .13 |
16:04.02 | thiag0 | therve: .13 isn't for the py 2.5 only? |
16:04.22 | therve | nope |
16:05.01 | therve | what give you this impression? |
16:26.58 | thiag0 | therve: I installed storm with setuptools |
16:27.20 | therve | thiag0: okay |
16:27.22 | thiag0 | the version .12 was installed |
16:27.26 | therve | when? |
16:27.41 | thiag0 | some days ago |
16:29.04 | therve | thiag0: okay, then try again :) |
16:29.17 | therve | 0.13 was release like 10 days ago |
16:29.30 | thiag0 | http://pypi.python.org/pypi/storm |
16:29.34 | therve | I just tried and I got .13 |
16:29.38 | thiag0 | okay, i will try |
16:31.49 | thiag0 | therve: now is .13 :) |
16:34.14 | therve | cool :) |
16:35.00 | thiag0 | therve: >>> from storm.locals import RightJoin |
16:35.08 | thiag0 | ImportError: cannot import name RightJoin |
16:35.41 | therve | yeah, it's in storm.expr |
16:36.03 | thiag0 | therve: oO |
16:36.04 | thiag0 | sorry |
16:36.06 | *** join/#storm fcorrea (n=fcorrea@c953f7fd.virtua.com.br) |
16:36.06 | thiag0 | :) |
16:36.12 | therve | it may worth adding it to storm.locals, but it's pretty unusual, so maybe not |
16:36.42 | thiag0 | yeah, works fine |
16:37.34 | *** join/#storm Exaurdon (n=IceChat7@12.191.193.40) |
16:40.08 | Exaurdon | Could 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.45 | jkakar | Exaurdon: You can use the Select expression to build up a subquery. |
16:41.50 | Exaurdon | The 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.03 | Exaurdon | *nod* I think I have figured out how to build the Select object. |
16:42.24 | Exaurdon | Can that be used in a join expression somehow? |
16:44.32 | jkakar | Exaurdon: Here's a crappy example: http://paste.ubuntu.com/45419/ |
16:44.44 | jkakar | Exaurdon: Ah, joining. Hmm. |
16:44.49 | jkakar | Exaurdon: I'm not really sure. |
16:45.18 | jkakar | Exaurdon: Have you tried using a Select with Join? |
16:45.36 | Exaurdon | I'm just trying to put soemthing like that together now |
16:45.44 | jkakar | Cool. |
16:45.55 | Exaurdon | but how do I refer to teh columns in the 'Slect' expression in my join clause? |
16:46.46 | jkakar | Hmm. I |
16:46.50 | jkakar | 'm not sure. :( |
16:47.23 | Exaurdon | I 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.33 | Exaurdon | What 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.01 | Exaurdon | So the result of the query should be tuples of customers, and their most recent purchases. |
16:53.22 | Exaurdon | So 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.30 | Exaurdon | hmm, 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.16 | Exaurdon | I.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.50 | jkakar | Hmm, cool. |
17:12.56 | Exaurdon | Ok, I think that is all working |
17:13.00 | Exaurdon | a couple quicks though |
17:13.21 | Exaurdon | I had to put Aliases on all of the columns in the subselect |
17:13.57 | Exaurdon | otherwise referencing colmun[0] would result in a reference to the 'original' column, no the one from the subselect |
17:17.01 | Exaurdon | I.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.43 | Exaurdon | when it needed to be ... Left Join (SELECT Customer.id as id FROM Customer) as foo on foo.id = Bar.id ... |
17:18.23 | Exaurdon | Anyway, I guess the ability to join a subquery exists, but looks to be a bit of a hack..... |
17:21.20 | radix | hmm |
17:21.32 | radix | I 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.06 | radix | ah yes |
17:22.28 | radix | Exaurdon: you may be able to avoid the column confusion by passing tables= explicitly in the subquery |
17:23.04 | Exaurdon | so passing in a list of the tables as a param to the Select constructor? |
17:25.21 | Exaurdon | Hmm, I just tried that, but it didn't seem to make a difference. |
17:26.12 | Exaurdon | The subquery is always built correclty, with or without the tables param being populated. |
17:27.42 | Exaurdon | However, 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) |