Grails maximum number of columns for a table - grails

There is some strange limit into grails,gorm about the maximum number of columns for a domain class (table)?
In the class definition with 192 columns hibernate create succesfully the table during application boot,with 193 no table is created and no errors in the application log

Related

Way to load mvcc tables automatically when DolphinDB starts?

I create the following 3 mvcc tables
n=5
syms=`IBM`C`MS`MSFT`JPM`ORCL`FB`GE
timestamp=09:30:00+rand(18000,n)
sym=rand(syms,n)
qty=100*(1+rand(100,n))
price=5.0+rand(100.0,n)
temp=table(timestamp,sym,qty,price)
t1= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],"/home/xjqian/mvcctables","t1")
t1.append!(temp);
t2= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],"/home/xjqian/mvcctables","t2")
t2.append!(temp);
t3= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],"/home/xjqian/mvcctables","t3")
t3.append!(temp);
Is there any way to automatically load all these tables when DolphinDB is started?
The script can be used to get all table names and load the tables:
login(`admin,`123456)
tables=select * from files("/home/xjqian/mvcctables") where isDir=true
for (tableName in tables.filename){
share( loadMvccTable("/home/xjqian/mvcctables",tableName) , "share_"+tableName)
}
Add it to the startup script startup.dos, so the tables can be loaded when the system is started. See the Startup Scripts for more information.
You can check whether the tables are loaded with objs(true):
select * from objs(true) where name like "share_%"
See the queried result:
name type form rows columns bytes shared extra
share_t1 MVCC TABLE 5 4 368 true
share_t2 MVCC TABLE 5 4 368 true
share_t3 MVCC TABLE 5 4 368 true

Combining two tables (Join) In data studio

I'm attempting to join two tables in Data Studio. My data sources are Google Ads and Microsoft ads. I'd like to end up with a table that looks like the following example:
Campaign
Clicks
Campaign 1
500
Campaign 2
700
The clicks from each table is added together to give a total.
When I attempt to join both tables, I get a result that looks like this (full example here):
Campaign
Clicks (Table 1)
Clicks (Table 2)
Campaign 1
100
400
Campaign 2
200
500
The data appears to be joined by 'campaign' but the 'clicks' are not being consolidated into one column, instead the clicks data from both tables are separate.
I've already attempted to solve this issue by:
Creating calculated fields in the newly blended data (Clicks Table 1+ Clicks Table 2) but this yields strange results when trying to aggregate other metrics.
Join using 'Clicks', however, this doesn't work as the number of clicks for each campaign is always likely to be different for each data source.
Change the join type from 'Left outer' to right outer, inner, full outer and cross but none of these appear to work either.
Grouping campaigns by a 'Campaign Group' calculated field using a CASE statement but this doesn't appear to work either- this generally results in only one set of data to show at a time (possibly whichever loads quickest).
Here's how my blend is setup. You can attempt to reproduce this issue using this page.
What is the best way to join both tables and have the metrics (like clicks) properly aggregated?
The values in the two separate fields, Clicks (Table 1) and Clicks (Table 2) can be consolidated using the calculated field:
Clicks (Table 1) + Clicks (Table 2)
This will work as long as there are no NULL values in either (or both) tables in the blend, for any given row of data.
This is because 1 + NULL = NULL (where 1 is used as an example to represent a number) as NULL is not a numeric literal (it's not a number, thus cannot be calculated)
Since this blend has NULL values, one approach is to use the IFNULL function ("returns a result if the input is null, otherwise, returns the input") below, which treats NULL values as a numeric literal (in this case, 0), so that the values can be calculated:
IFNULL(Clicks (Table 1), 0) + IFNULL(Clicks (Table 2), 0)
This will ensure that calculations are changed:
1 + NULL = NULL is replaced by 1 + 0 = 1
NULL + NULL = NULL is replaced by 0 + 0 = 0
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:

Neo4j creating relationships

I've got two csv files imported into neo4j named : uniq_names and all_names. I've got one column and about 5000 rows in uniq_names file , and i've got three columns : name , id1 and id2 it's about 300000 rows in all_names file.
Now i'm trying to create relationship with code below:
MATCH (a:uniq_names),(b:all_names)
WHERE a.name=b.name AND b.id1<>b.id2
CREATE (a)-[:child]->(b);
as i execute the code it thinks about 20 minutes but returns: " 0 rows returned " as result , and it down't create any relationship.it works perfectly when i've got 1000 rows in all_names file and 50 rows in uniq_names file
I've got windows 7 64bit, jdk 1.7.0_71, neo4j 2.1.6 enterprise. Any ideas?
That query basically creates a cross product of you 5k uniq_names and 300k all_names, so 1.5bn operations - is not very efficient.
To optimize:
Create an index: CREATE INDEX ON :all_names(name). Then first go over all uniq_names and find corresponding all_names via an index lookup, check the id condition and create the relationships:
MATCH (a:uniq_names)
WITH a
MATCH (b:all_names {name: a.name})
WHERE b.id1<>b.id2
CREATE (a)-[:child]->(b);

Remove Many-to-many relations records in database with entity framework

If I have many to many relation ship in database witch is looking like that:
House-HouseType-Type
In data model it is looking like that
House-Type
I cant modify table HouseType directly because there is no entity for that.
For example if I have insert some entities in database after records in table HouseType looking like that:
HouseId TypeId
1 2
1 3
1 4
than I want to remove some relations records.
e.g Records in table after remove would be:
HouseId TypeId
1 2
How can I do that in Entity Framework 4 ?
house.Types.Remove(type)
or
type.Houses.Remove(house)

350+ errors: The type 'blah.blah.blah' already contains a definition?

What does this mean. Is it because I have two different .DBML files that contain the same database table?
...
Error 343 The type 'mvc.Models.Bundle' already contains a definition for 'BundleIcon' C:\inetpub\wwwroot\Models\Assets1.designer.cs 3438 17 mvc
Error 344 The type 'mvc.Models.Bundle' already contains a definition for 'isScorm' C:\inetpub\wwwroot\Models\Assets1.designer.cs 3459 15 mvc
Error 345 The type 'mvc.Models.Bundle' already contains a definition for 'scormPath' C:\inetpub\wwwroot\Models\Assets1.designer.cs 3480 17 mvc
Error 346 The type 'mvc.Models.Bundle' already contains a definition for 'CompanyID' C:\inetpub\wwwroot\Models\Assets1.designer.cs 3501 14 mvc
...
Yes, if you keep them in the same namespace this would occurr.
OK, I came across this same error when adding another Linq-to-SQL .dbml.
The more specific cause is that you can not have 2 separate .DBML's in the same namespace which reference the same table and column.
Unlike in Datasets, wherein you can have 2 separate Datasets (Dataset1.xsd and Dataset2.xsd) weach ith the same table and same columns, not so in Linq.
DataClass1.dbml with table MyTable with a column myColumn and DataClass2.dbml with table also name MyTable with a column myColumn will fail because myColumn is defined in both designer.cs files within the same namespace.
My workaround: I 'renamed' DataClass2.dbml's MyTable to MyTable_2 and myColumn to myColumn_2.
I then cursed Microsoft, deleted DataClass2.dbml and integrated the 3rd table I needed into DataClass1.dbml, along with other tables (to avoid this issue). DataClass1.dbml now has some 40 tables in it, which now causes the DataClass1.designer.cs file to have over 20,000 lines of 'auto-generated' code.
Lovely, eh.

Resources