1. fix JdbcWrite bug

2. update flyway sql script
This commit is contained in:
judy0131 2019-12-23 14:42:31 +08:00
parent 6446a40f1a
commit e0de110462
3 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,8 @@ import org.apache.spark.sql.{SaveMode, SparkSession}
import scala.beans.BeanProperty
class JdbcWrite extends ConfigurableStop{
class
JdbcWrite extends ConfigurableStop{
val authorEmail: String = "xjzhu@cnic.cn"
val description: String = "Write data into jdbc database"
@ -47,16 +48,16 @@ class JdbcWrite extends ConfigurableStop{
var descriptor : List[PropertyDescriptor] = List()
val url=new PropertyDescriptor().name("url").displayName("url").description("The Url, for example jdbc:mysql://127.0.0.1/dbname").defaultValue("").required(true)
descriptor = url :: descriptor
//descriptor = url :: descriptor
val user=new PropertyDescriptor().name("user").displayName("user").description("The user name of database").defaultValue("").required(true)
descriptor = user :: descriptor
//descriptor = user :: descriptor
val password=new PropertyDescriptor().name("password").displayName("password").description("The password of database").defaultValue("").required(true)
descriptor = password :: descriptor
//descriptor = password :: descriptor
val dbtable=new PropertyDescriptor().name("dbtable").displayName("dbtable").description("The table you want to write").defaultValue("").required(true)
descriptor = dbtable :: descriptor
//descriptor = dbtable :: descriptor
descriptor = url :: descriptor
descriptor = user :: descriptor

View File

@ -1,3 +1,3 @@
create table if not exists flow (id varchar(255), groupId varchar(255), projectId varchar(255), pid varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255));
create table if not exists flow (id varchar(255), pid varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255));
create table if not exists stop (flowId varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255));
create table if not exists thoughput (flowId varchar(255), stopName varchar(255), portName varchar(255), count long)

View File

@ -1,6 +1,5 @@
create table if not exists PROJECT (id varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255));
create table if not exists FLOWGROUP (id varchar(255), projectId varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255));
create table if not exists FLOWGROUP (id varchar(255), projectId varchar(255), name varchar(255), state varchar(255), startTime varchar(255), endTime varchar(255), FlowCount int);
alter table FLOW add column GROUPID varchar(255);
alter table FLOW add column PROJECTID varchar(255);
alter table FLOWGROUP add column FLOWCOUNT int;