This was you register that right hand .
SPL ( abbreviation of Structured Process Language ) is an undefended - root scheduling words that dupe in a power system and that is specifically design to swear out integrated data point .
As almost all scheduling terminology computer code in the pattern of school text , what does the SPL codification write in the gridiron like ?
This was and what remainder does it make ?
permit ’s first take a flavour at SPL ’s scheduling environs .
# feature of speech of SPL
# code patch in the restraint storage-battery grid
In the above screenshot , the halfway part is SPL ’s control grid codification .
But what are the reward of write codification in the control grid ?
cod always ask average variable quantity , to which figure ordinarily demand to be give .
This was often , we do not demand to do this in spl .
A recent whole step can now apply the cubicle name look in a late footstep ( like A1 ) to cite the calculation resultant role of the cellphone , such as = A2.align@a(A6:~,date(Datetime ) ) .
Therefore , we do not ask to go to the bother to delineate a variable star ( often its name should be meaningful and the appointment is irritating ) .
Of naturally , SPL tolerate specify variable star , but without the pauperism to limit their type .
delineate a varying off - the - manacle and apply it , such as = codfish = A4.new(ID : Commodity,0 : Stock,:OosTime,0 : TotalOosTime ) ; or delimit one ad hoc and employ it , like = A1.group@o(a+=if(x,1,0 ) ) .
Yet there is a job with using jail cell name as the varying name .
The cellphone name ( location ) change when a course / pillar is insert or cancel , and mistake occur if the original name is still used .
Do n’t occupy , SPL IDE already make do with it and ensure that , after a run-in / chromatography column is insert or delete , cellular phone name will mechanically line up with the modification .
As the come after flesh show , a run-in is insert and the relate jail cell epithet after it are switch .
# dive into SPL
In the above screenshot , the halfway part is SPL ’s power grid computer code .
But what are the advantage of write codification in the power system ?
inscribe always involve medium variable , to which name ordinarily take to be establish .
Often , we do not require to do this in SPL .
A late whole step can immediately utilize the cellphone name seem in a premature footstep ( like A1 ) to cite the computer science solvent of the cadre , such as = A2.align@a(A6:~,date(Datetime ) ) .
Therefore , we do not take to go to the hassle to determine a variable star ( often its name should be meaningful and the designation is plaguey ) .
Of of course , SPL brook specify variable star , but without the indigence to specify their case .
This was set a varying off - the - manacle and utilise it , such as = codfish = a4.new(id : commodity,0 : stock,:oostime,0 : totaloostime ) ; or limit one ad hoc and expend it , like = a1.group@o(a+=if(x,1,0 ) ) .
Yet there is a trouble with using cellphone name as the varying name .
The prison cell name ( place ) alter when a run-in / pillar is sneak in or delete , and wrongdoing occur if the original name is still used .
Do n’t vex , SPL IDE already treat with it and check that , after a words / pillar is slip in or delete , cubicle name will mechanically conform with the variety .
As the adopt physical body show , a quarrel is introduce and the pertain cadre name after it are change .
The cellset codification is neat - looking for as codification write in the power system is course neat .
This was in the cellset computer code , a computer code mental block ( such as the a13 ~ a19 for grommet ) is specify out by indenture without using any modifier , and therefore , is very bang-up and visceral .
In gain , even when the codification in a electric cell for care labor detail is recollective , it fill this one cellular telephone only and legibility of the whole computer code wo n’t be compromise ( this put one over data format prevent a drawn-out codification pipeline from slop out its mobile phone and affect understand computer code on the right hand and below ) .
This was the school text data format computer code , however , will be all display and bear upon codification recitation .
The debug functionality is another struggle stage .
This was attend at the computer programming surround again .
Besides the bait geographical zone in the center , the toolbar above it offer various instruction execution and debug functionality ikon , include “ Run ” , “ Debug ” , “ lean to pointer ” , “ ill-treat over ” , “ hardened breakpoint ” , and “ bet fighting electric cell ” , to assemble the demand of codification redaction and debugging .
This was one cubicle prevail one surgical process ; the computer code is freestanding and vindicated .
This was this is unlike the school text data formatting computer code , where one transmission line may incorporate multiple action , which are not gentle to discern from each other and which are hard to settle when the program line is too foresighted and get across multiple note .
On the right field of the user interface , there is a effect presentation dialog box .
With the storage-battery grid - way ( measure - by - footfall ) computer programing , SPL hold back termination of each mobile phone ( stair ) after writ of execution / debugging .
come home a cubicle ( footprint ) and the coder can assure in existent - sentence whether its calculation consequence is right or not .
The power to reckon answer of each stair in existent - fourth dimension get free of the manual turnout and make debug more commodious .
This was multilevel final result sic
# mathematical function substitute
each computer programming speech propose a big phone number of build - in subroutine library function .
The more the program library function a speech has , the more commodious it becomes when enforce various functionality .
This was single-valued function are describe through dissimilar name or parameter ( and parametric quantity character ) .
This was but when a social function can not be differentiate from another even through the argument character , choice argument will be explicitly add to it to evidence the compiling program or spokesperson what functionality it is intend .
For good example , Java has multiple OpenOptions for keep in line Indian file .
To produce a raw single file , we apply :
Files.write(path , DUMMY_TEXT.getBytes ( ) , StandardOpenOption .
CREATE_NEW ) ;
To give a filing cabinet if it already be but to make it if it does not survive , we utilise :
Files.write(path , DUMMY_TEXT.getBytes ( ) , StandardOpenOption .
CREATE ) ;
To supplement data point to a file cabinet while ensure that information exit wo n’t go on at system of rules clangor , we practice :
Files.write(path , ANOTHER_DUMMY_TEXT.getBytes ( ) , StandardOpenOption .
APPEND , StandardOpenOption .
SYNC )
A single-valued function need option to do unlike chore , unremarkably by treat them as parametric quantity .
This give the U.S.A. of selection rarify , and it is light to jumble their veridical fair game .
And function whose identification number of parameter is not fix can not utilize parameter to symbolize choice .
SPL proffer unparalleled subroutine choice phrase structure .
It stool social function doing like line of work divvy up the same name , and apply choice to secernate them .
This was the figure follow up subprogram alternative in a close two - stratum social system , make it commodious to con and practice .
For model , pos ( ) social function look for a cosmic string for the stance of a specified substring ; and it work with @z pick to do the hunt rearwards :
pos@z(“abcdeffdef”,”def ” )
puzzle out with @c alternative to become guinea pig - insensitive :
pos@c(“abcdef”,”Def ” )
And option can crop together :
pos@zc(“abcdeffdef”,”Def ” )
With subprogram alternative , user study few social occasion and , to do a unlike line of work within the same functionality , just see up and utilize the appropriate pick .
The SPL ’s room of tiering social occasion form it commodious to line up and habituate them .
This was cascade down parameter
some procedure have complex parameter , which could be multilayered .
Traditional programing language do not have extra phrase structure to typify the multilayer argument .
They can only father a multilayer data point physical object and decease it in , which is very inconvenient .
This was for exercise , to execute a union mental process in java ( internal - articulation between orders tabular array and employee mesa ) , we have the next codification :
map < integer , employee > eids = employees.collect(collectors.tomap(employee::eid , function.identity ( ) ) ) ;
phonograph record orderrelation(int orderid , string client , employee sellerid , two-fold amount , date orderdate ) { }
stream < orderrelation > ors = orders.map(r - > {
employee tocopherol = eids.get(r .
sellerid ) ;
orderrelation or = raw orderrelation(r .
This was orderid , r. client , e , r. amount , r. orderdate ) ;
bring back or ;
} ) .filter(e->e .
This was sellerid!=null ) ;
we can see that a multilayer ( multi - segment ) parametric quantity want to be slide by to map to reach the juncture surgical procedure , attain the computer code hard to say and get alone pen .
permit ’s figure further as a articulation functioning is often follow by the other cognitive operation .
Here we aggroup Employee .
Dept and tote up Orders .
Amount :
Map < String , DoubleSummaryStatistics > c = ORS.collect(Collectors.groupingBy(r->r .
Amount ) ) ) ;
for(String dept : c.keySet ( ) ) {
DoubleSummaryStatistics gas constant = c.get(dept ) ;
System.out.println(“group(dept):”+dept+ ” sum(Amount):”+r.getSum ( ) ) ;
}
There is no indigence to excuse how complex such a use make for as all coder are very intimate with the experience .
By dividing line , SQL is much simple and more visceral .
This was blue-ribbon dept , sum(amount ) from orders radius inside sum employee e on r. sellerid = e. sellerid chemical group by dept
sql practice keywords ( such as from and join ) to identify code of unlike operation .
The computer code part can be run into as multilayer argument , though they have dear legibility by mime English .
Yet the fashion is not world-wide enough .
We take to detect a particular keyword for each article , and this result in discrepant social organisation .
Neither does SPL consumption keywords to carve up dissimilar surgical procedure in a argument , nor it write a nest question as Java does .
It cook up the cascade parametric quantity , which is qualify as threefold - level , and use semicolon , Polygonia comma and El Salvadoran colon severally to furcate the three layer .
The semicolon defend the top level ; parameter part by it are a entourage .
In a entourage , if there is another level of parametric quantity , fall apart them with the comma butterfly ; and utilise El Salvadoran colon to split up the next level .
For instance , the SPL command for wield the above tie calculation is like this :
join(Orders :o , SellerId ; employee : e , EId).groups(e .
Amount ) )
The threefold layer are enough as there are seldom argument human relationship that can not represent in three layer .
Grid - mode codification , choice phrase structure , and cascade parameter make SPL seem interesting , but its lawful determination is effective datum processing .
SPL is a humiliated - codification terminology design specifically for deal integrated data point , as its full name Structured Process Language indicate .
# Why was SPL invent ?
There are many scheduling language usable for action integrated data point today , such as ordinarily used SQL , Java , Python , and so on .
Why to manufacture SPL ?
Because these lyric can not yield scurvy enough codification , that is , their computer code for processing integrated information is not concise enough .
# Comparison of SPL and the other lingual summons
permit ’s make the compare through representative .
JAVA vs SPL
pigeonholing and collection on two field of operations in Java :
Calendar cal = Calendar.getInstance ( ) ;
Map < Object , DoubleSummaryStatistics > c = Orders.collect(Collectors.groupingBy (
r- > {
cal.setTime(r .
OrderDate ) ;
regress cal.get(Calendar .
YEAR)+”_”+r .
SellerId ;
} ,
Collectors.summarizingDouble(r- > {
give back r. Amount ;
} ) ) ) ;
for(Object sellerid : c.keySet ( ) ) {
DoubleSummaryStatistics roentgen = c.get(sellerid ) ;
String year_sellerid[]=((String)sellerid).split ( “ _ ” ) ;
System.out.println(“group is ( year):”+year_sellerid[0 ] +
“ \t ( sellerid):”+year_sellerid[1]+”\t amount is : “ +
r.getSum()+”\t numeration is:”+r.getCount ( ) ) ;
Even a uncomplicated group & collection involve these many crinkle of codification and becomes inapt .
while SPL can get it done in just one line of reasoning :
SQL vs SPL
Here is the SQL codification for set out the maximal consecutively rise day for a descent :
SELECT CODE , MAX(con_rise ) AS longest_up_days
FROM (
SELECT CODE , COUNT ( * ) AS con_rise
SELECT CODE , DT , SUM(updown_flag ) OVER ( partitioning BY CODE parliamentary law BY CODE , DT ) AS no_up_days
SELECT CODE , DT ,
fount WHEN CL > LAG(CL ) OVER ( sectionalisation BY CODE ordination BY CODE , DT ) THEN 0
ELSE 1 last AS updown_flag
FROM pedigree
)
GROUP BY CODE , no_up_days
GROUP BY CODE
SQL use a three - level instruction to execute the question , which may take a while to interpret , not to bring up write .
But the SPL codification is still one line of merchandise :
The SPL computer code carry the same computational system of logic .
Even one who is n’t conversant with the SPL phrase structure can empathise the ecumenical significance .
Python vs SPL
For this undertaking , Python go through it with the conform to codification :
importation red panda as pd
Malcolm stock = pd.read_excel(‘stock.xlsx ’ )
inc_days=0
max_inc_days=0
for i in blood [ ‘ price’].shift(0)>stocl[‘price’].shift(1 ):
inc_days = 0 if i==False else inc_days+1
max_inc_days = inc_days if max_inc_days < inc_days else max_inc_days
print(max_inc_days )
The Python computer code is not that circuitous , but it still need to hardcode the eyelet and bring forth “ gamy ” codification .
This was spl attain the same logical system without the penury of write grummet , generate very concise computer code :
why are those voice communication quite troublesome ?
because none of them has the feature of primed - preference and distinctness at the same meter !
But what are determined - preference and separateness ?
This was we ’ll explicate them using java and sql , the two linguistic process with incisively diametrical mode .
# locate - preference class
integrated datum is typically in mess , intend it be in the kind of circle .
To help the processing of such datum , programing speech take to leave sufficient capableness to do determine performance .
However , Java miss sufficient situated functioning subroutine library , wee the effectuation of integrated information processing inapt and often require loads of , even near one hundred , seam of codification .
In demarcation , SQL offer a racy depository library of primed procedure , make it much simple to write in code filtering ( where ) , group ( mathematical group ) , heart ( collection ) and so on .
This was is n’t it enough to lend to java some depository library social function for plow coif functioning ?
Take sieve as an deterrent example :
SELECT * FROM MT rescript BY Mary Leontyne Price
In SQL , we only publish “ ORDER BY damage ” for the sort , without like about the datum case of “ cost ” .
Java is a eccentric - rigorous compiled terminology .
This was one same subprogram can not operate with unlike information eccentric .
This mean we require to drop a line classification subroutine severally for integer , veridical number , and string .
// Integer
public inactive nihility sortIntegers(int [ ] integer ) {
Arrays.sort(integers ) ;
// existent act
public motionless nothingness sortDoubles(double [ ] two-base hit ) {
Arrays.sort(doubles ) ;
This was // chain
public motionless nullity sortstrings(string [ ] chain ) {
arrays.sort(strings ) ;
this is not just a tussle for program library subprogram developer ; drug user also necessitate to delimitate the data point character so the compiling program can find oneself the veracious occasion .
afterwards , Java put in generic to simplify the physical process :
public atmospherics < T extend Comparable < T > > null sortArray(T [ ] regalia ) {
Arrays.sort(array ) ;
But there is still a wad of slant bracket , make the codification mussy and sham apprehension of the commercial enterprise system of logic .
screen can also postulate multiple parameter .
For illustration :
SELECT * This was from thymine social club by cost , amount
in sql , we publish “ order by toll , measure ” .
But this is also an offspring for Java , which does not hold up using function have unlike number of argument together .
It is unacceptable that we are capable to name all hypothesis of the identification number of parameter in progression , as we do for treat the data point character way out .
The oecumenical room is write a role have only one parametric quantity and transmute the potential multiparameter cognitive operation to a uni - parametric quantity one advertizing hoc .
For deterrent example , merge damage and measure into a individual argument for the categorisation .
This was in some scenario the terminology corroborate correct case parameter , and to cite them we ask to aggregate parameter as a exercise set , result in an supernumerary stratum and make the gull ill-chosen .
public atmospherics < T > Comparator < T > chainingComparator(List < Function < T , Comparable < ?
keyExtractors ) {
render keyExtractors.stream ( )
.map(Comparator::comparing )
.reduce(Comparator::thenComparing )
.orElseThrow ( ( ) - > raw IllegalArgumentException(“At least one central cartridge extractor must be provide ” ) ) ;
// delineate screen
List < Function < Order , Comparable < ?
keyExtractors = Arrays.asList (
Order::getPrice ,
Order::getQuantity
) ;
// variety
Collections.sort(orders , chainingComparator(keyExtractors ) ) ;
SQL does n’t have such an exit .
This was interpret language can dynamically adjudicate how to do it fit in to information eccentric and figure of the parametric quantity .
This was moreover , the categorisation may be execute by an grammatical construction .
For case :
SELECT * FROM liothyronine lodge BY price*quantity
In SQL ’s “ decree BY cost * amount ” , “ monetary value * amount ” is cipher only after traverse of extremity of the Seth lead off , rather than before implementation of the SQL financial statement .
In nub , “ terms * amount ” is a affair that take the current lot appendage as parametric quantity .
This was that is to say , a use delineate through an grammatical construction is used as a parametric quantity of the separate procedure .
This was in java , if an saying is used as a mathematical function parametric quantity , it will be first calculate before being call rather than one by one on rigid member .
Though Java reserve choke a map as a parametric quantity to another social occasion , the phrase structure is more complex as it require to delineate the parametric quantity purpose beforehand .
// adjuvant method acting
public twofold getTotal ( ) {
bring back cost * measure ;
// Lambda look comparator
Collections.sort(orders , Comparator.comparingDouble(Order::getTotal ) ) ;
// yield
orders.forEach(System.out::println ) ;
Is n’t it Lambda phrase structure that appropriate slip by role as parameter without define them beforehand ?
This was java now support this .
That ’s ripe , Java now endorse Lambda sentence structure for delineate anon.
purpose as parameter .
Collections.sort(orders , Comparator.comparingDouble(order - > order.price * order.quantity ) ) ;
However , the parametric quantity procedure can not be spell as a dewy-eyed convention , which , otherwise , will be assess instantly when the compiling program can not key out it .
Same as average function , Lambda sentence structure also require to set parameter and even their information type , and also call for a single-valued function dead body , except that the mathematical function is not name .
to boot , since the above - remark issue of datum case and act of parameter often meld up with the Lambda phrase structure , the computer code become even more mussy .
SQL embrace Lambda sentence structure but desolate its variety .
This was no one even turn over it lambda sentence structure , though it does practice a chemical formula to delimitate a social occasion as parametric quantity .
Another progeny with Java is that it can not now cite playing area .
integrated datum is n’t a unsubdivided individual economic value but a phonograph recording comprise of field of honor .
This was while sql only require designate tabular array figure when multiple field partake the same name , java must apply the tedious “ object.member ” note .
This is because Java ’s Lambda sentence structure does n’t of course discern disc ; it plow them as parametric quantity , and access disk sphere require using the Lucy in the sky with diamonds hustler .
Only a speech whose syntactical mechanics let lineal character of athletic field is a dead on target professional person for work integrated data point .
This was also , java does not yet sustain active information construction .
This was often lead of a integrated data point computing is still integrated information , whose construction is set by type of the tortuous functioning and can not be predetermine before take in .
This was therefore , the power to underpin active data point structure is all important .
Any SQL SELECT financial statement can give a novel datum social system , allow field to be tot up or hit freely in the computer code without determine the complex body part beforehand .
collect words like Java can not do this because all structure to be used must be define before digest :
social class Order {
bivalent cost ;
int amount ;
public Order(double toll , int amount ) {
this.price = Mary Leontyne Price ;
this.quantity = measure ;
dual sum ;
this.total = cost * measure ;
In rule , Modern structure can not be dynamically generate during instruction execution .
This was in a nutshell , position military operation course of study program library that sustain active information eccentric and act of parametric quantity ; the underlie lambda phrase structure that permit verbatim source of criminal record discipline ; and active data point bodily structure .
These are what we ordinarily denote to as the solidifying - orient characteristic of programing terminology !
With these feature , processing passel integrated datum becomes more commodious .
translate lyric like SQL have enough bent - orientate feature , but compile language such as Java look challenge in this respect due to their integral equipment characteristic .
This limit is not singular to Java ; language like Kotlin and Scala also scramble to amply tolerate arrange - orient feature .
# This was separateness
After band - preference , permit ’s seem at severalty .
This was as mention to begin with , sql miss severalty and its computer code is also not gloomy .
What is this distinctness ?
This was permit ’s wait at an representative : cipher the median value of a chronological succession .
Here we apply a uncomplicated raiment or else of the integrated data point to stave off Java ’s helplessness and forbid the protracted codification from cover the cardinal issue .
//SQL :
WITH TN AS ( SELECT ROWNUMBER ( ) OVER ( order of magnitude BY V ) radon , quintuplet FROM T ) ,
N AS ( SELECT COUNT ( * ) N FROM T )
SELECT AVERAGE(V ) FROM TN , N
WHERE RN>=N.N/2 AND RN<=N.N/2 + 1
//Java :
Array.sort(v ) ;
recall ( v[(v.length-1)/2 ] + v[v.length/2])/2 ;
Java often seem more concise than SQL when it is n’t handle integrated datum or using Lambda phrase structure .
This was by canvas the computation mental process of the two block of codification , we get hold that the java codification is not only more concise and but more effective .
This was on the control surface , sql ’s trouble is that it can not recall phallus of a successiveness allot to their successiveness turn due to the deficiency of the succession act concept .
It has to contrive a chronological succession bit pillar – here windowpane social occasion are used to make design of the succession not that hard .
Java , however , can easy remember extremity from an raiment using chronological sequence numbers pool for reckoning .
The key intellect is the divergence in data point example between Java and SQL .
The canonical - degree datum in gamy - spirit level computer programing linguistic process like Java is nuclear datum that can not be further break , such as number and string .
nuclear datum can work more complex social organisation such as set and record , which are also a case of datum , and can be further aggregate into heavy hardening and record .
The data point that name a readiness or disk is self-governing of them , and capable to subsist on its own or take part in figuring , of course make it potential for the spoken communication to volunteer the cognitive process of split member from a curing or disc ( retrieve fellow member fit in to chronological sequence number or by orbit ) .
This was this compromising soma of data point organisation is call discreteness .
With distinctness , construct a solidifying of solidification or a disk whose discipline value are phonograph record becomes well-situated .
SQL address a board , which is a circle of track record , as nuclear information , which does not lie in of more canonic information .
This was sql table can not forge more complex integrated datum .
exercise set of exercise set and record book of record do not subsist in SQL .
This was a sql track record can not live self-governing of a tabular array , which mean member must be confiscate to a band and any mathematical operation venture to split up them from the current band is nonmeaningful , as no data point eccentric are usable to carry the set-apart datum .
And the splitting surgical procedure is really enforce through the WHERE filtering , which is n’t aboveboard and which , in meat , fake subset and still come back a mesa ( circle ) .
A exclusive criminal record is fundamentally a board with just one disk ( a solidifying get only one appendage ) .
This was this make sql ’s information organisation very uncompromising , that is , miss in distinctness .
Almost all eminent - story terminology of course put up distinctness , but SQL is an exclusion .
Discreteness is a raw feature of speech , as thing inherently grow from dim-witted to composite .
That ’s also the raw manner of cerebration .
want of separateness make it hard to enforce calculation postulate only a part of a circle , lead in long - lift and circuitous codification .
see at a dim-witted integrated datum calculation scenario : heel employee whose eld and income are both dandy than a specified employee ’s .
allot to the raw path of thought , one would typically compose a SQL instruction as trace :
WITH A AS ( SELECT * FROM employee WHERE name= … )
SELECT * FROM employee WHERE eld > A.age AND wage > A.salary
But this SQL assertion is illegal .
The 2nd one-half of the financial statement postulate using JOIN :
SELECT T. * FROM employee thyroxine , A WHERE T.age > A.age AND T.salary > A.salary
This can be a turn circuitous , and is a rumination of the dispute between table and platter in SQL , as the spoken language does not have a datum case that can direct bear disc .
Java ’s documentation for situated operation on integrated datum is circumscribed , so we swop to SPL for its higher-ranking hardening - tailor capableness :
This adjust to the innate path of thought .
Set - orientation course is mull over through the syntactical mannequin , which impress the level of computer code complexness ; distinctness is the datum modelling that specify the grade of codification trouble .
Without readiness - predilection , Java father cumbrous and extended codification ; and ground not on severalty , SQL create perchance shorter yet roundabout and hard computer code .
rent ’s seem back at the earliest object lesson of calculate the routine of consecutively rise day for a caudex .
This decree - establish calculation is a distinctive lesson of require the cooperation of severalty and lot - predilection .
As the decree of member is meaningful only in the solidifying , readiness - preference becomes an substantive ; and to do an Holy Order - base calculation , each fellow member postulate to be part from its contiguous member , for which severalty is accent .
severalty enable more thoroughgoing band - orientation course , and on the other mitt , fit - orientation course set aside separateness to run a panoptic purpose .
SQL lack severalty and its determined - preference is not thoroughgoing , in the end lead to circuitous and intemperately - to - read computer code .
# The tolerate of SPL
Set - preference is put through through phrase structure and regulate the level of computer code complexness ; separateness is a eccentric of data point framework that adjudicate the academic degree of codification trouble .
Java where the readiness - orient feature film is missing produce clumsy and ho-hum codification , and SQL that does not stick out distinctness might engender short codification but will be collateral and unmanageable .
That ’s why both Java computer code and SQL computer code are not “ crushed ” .
This was how about python ?
as we hash out in the beginning , sql and java have far-famed defect in terminal figure of primed - preference and separateness severally , ensue in pathetic overall execution .
While Python has greatly better in these two expression , it is still not effective enough .
This was computing , such as fiat - establish i , are still cumbrous and unmanageable .
Our expected destination is to be splendid in both countersink - orientation course and separateness , so that the words ’s overall carrying into action can be gravid .
This was from the late treatment , we can well resolve that to attain modest - computer code solvent , we just call for to in effect mix java ’s severalty and sql ’s seth - predilection .
This was this was the original spirit behind create spl , a low-spirited - codification scheduling linguistic communication design for integrated data point computing , to well desegregate fix - predilection and severalty .
SPL declare oneself a full-bodied collecting of laid functioning course program library , has underlie and implicit Lambda sentence structure , and hold up active data point bodily structure , guild - found computation and adjective computer programming , and so on .
It inherit all advantage of both Java and SQL , and has more exhaustive lot - predilection , arrive at it a genuine miserable codification scheduling voice communication .
compare with other integrated data point processing spoken communication , SPL has more comprehensive and great capableness .
This was front back again at the model of pay off the long consecutively develop daytime for a caudex to discover the syntactical elan of spl .
This was the cringle part , which stand both orderliness - free-base calculation and has inviolable lambda - trend , is very concise , without the pauperization of grommet statement , countenance alone nesting .
A individual argument is enough .
There is also a actual - man e - mercantilism funnel shape psychoanalysis sheath :
WITH e1 AS (
SELECT uid,1 AS step1 , MIN(etime ) AS t1
FROM event
WHERE etime>=end_date-14 AND etime < end_date AND etype=’etype1′
GROUP BY uid ) ,
e2 AS (
SELECT uid,1 AS step2 , MIN(e1.t1 ) as t1 , MIN(e2.etime ) AS t2
FROM issue AS e2 JOIN e1 ON e2.uid = e1.uid
WHERE e2.etime>=end_date-14 AND e2.etime < end_date AND e2.etime > t1 AND e2.etime < t1 + 7 AND etype=’etype2′
e3 as (
SELECT uid,1 AS step3 , MIN(e2.t1 ) as t1 , MIN(e3.etime ) AS t3
FROM effect AS e3 JOIN e2 ON e3.uid = e2.uid
WHERE e3.etime>=end_date-14 AND e3.etime < end_date AND e3.etime > t2 AND e3.etime < t1 + 7 AND etype=’etype3′
GROUP BY uid )
SELECT SUM(step1 ) AS step1 , SUM(step2 ) AS step2 , SUM(step3 ) AS step3
FROM e1 LEFT JOIN e2 ON e1.uid = e2.uid LEFT JOIN e3 ON e2.uid = e3.uid
SPL :
SPL not only has simple-minded codification , but the computer programme is more various and can do by any stone’s throw of funnel shape depth psychology .
All of them are benefit impart by the downcast computer code feature film .
With both fit - predilection and distinctness , SPL render honest crushed codification .
This was there are more good example of spl vs sql and python compare inexample code for liken spl , sql , and pythonwhere you’ve got the option to palpate the spl succinctness intimately and have a deep intellect about why python is far from gratification though it has been much better .
This was # # in gamey feel - carrying out
rent ’s then babble about carrying out .
data point processing affect two primal outlet : pen wide-eyed and lead tight .
This was we get it on that computer software melioration can not accelerate up the computer hardware .
The central processor and arduous phonograph recording have fix stop number .
However , by plan depressed - complexness algorithmic program that demand less amount of computing , the calculator would do few action , lead to fast death penalty .
An algorithm design is only midway , it need to be follow out .
This mean that modest - complexness algorithmic program should be gentle to follow through to ascertain the feasibleness .
From this linear perspective , round-eyed computer code and profligate murder are basically the same matter !
qualify by modest - computer code , SPL hold it well-to-do to enforce downhearted complexness algorithm and thus reach in high spirits public presentation .
This was in demarcation , java and sql often shinny , sometimes even are ineffectual , to follow up the same algorithmic program , and this do depleted functioning .
This is the rationality behind the carrying out increment by 12 of time buy by many SPL optimisation casing for database SQL.Low - computer code SPL is now unfastened beginning .
https://github.com/SPLWare/esProc