zoukankan      html  css  js  c++  java
  • SSIS WITH VERTICA的注意事项总结

    项目中使用到SSIS访问vertica,以下是我使用中总结的一些注意事项:

    1.vertica对约束的处理方式与之前的DBMS是不同的。

    以上的截图说明,在使用ado.net provider连接vertica进行数据加载的时候,ssis 返回的信息是不准确的。这不是provider的问题,使用odbc时也遇到过类似的问题。

    a.SSIS中图显示全部绿色,表示执行成功,但是到vertica中查询,却没有发现一条记录。

    后仔细检查发现,source中的数据违反了vertica中的一个not null 约束,数据没有进去,但是没有报错误提示。 Ssis path中显示343条记录,但是实际上只有341条记录,也有两条记录违反约束。

    但是没有错误提示。

    b.给表添加了unique(primary)约束,但是数据仍然可以是重复的。vertica官方文档说是vertica这样做加快了处理速度,减少了检查约束造成的性能损失,有利于大量数据加载。

    你可以使用ANALYZE_CONSTRAINTS('shcema.tablename')来检查表中的违约情况。

    那是不是就需要你保证数据在进入之前是符合条件的?还是需要怎么处理?

       

    2.vertica is case sensitive when compare row content.

    Select table_name from tables where table_name='abc' or table_name='Abc'

    是不同的

    3.vertica中的merge有些限制与mssqlserver是不同的,它不允许使用subquery,也不允许对表中有identitybind senquencecolumn存在的时候进行merge.

    You should find some workaround to do this when you need merge to load data.

    a.not need subquery, you can use temp table.

    b.not used identity column, you can remove them , or unbind the column and sequence.

    You should know that , when you create a identity column, in fact, vertica create a sequence and bind this to your column.

       

    4.jdbc ,ado.net provider中处理的数据精度和vsql client tool是不一样的,timestamp类型默认可以接受6位以内的微秒精度。但是在jdbc ado.net provider 作为连接的工具中查询时,你是无法看到这些秒后面的小数值的,如果你使用这种字段作为增量加载的依据,你会发现有一定的误差。

    我暂时的处理方案是让它转成varchar类型后接收,这样不会丢失精度。

       

    5.vertica支持到sql92标准,很多sql statement 的写法是与sqlserver的Tsql是不同的,以下是我发现的一些常见的不同之处,很多是因为那是TSQL中的实现,不是标准的sql.

     a.top n in tsql, you should change to limit n when you want to restrict the record counts.
    
     b.you can not delete records in CTE. This is also tsql's specification. 
    
     c.update and delete statement different with tsql. 
    
     tsql: 
    
     delete from a 
    
     from mytablea as a 
    
     join mytableb as b 
    
     on a.column1=b.column1 
    
     and a.column2=b.column2 
    
     and …. 
    
     
    
    vsql: 
    
     delete from mytablea 
    
     where exists 
    
     (select null from mytableb as b where mytablea.column1=b.column1 
    
     and a.column2=b.column2 
    
     ) 
    
       
    
    tsql: 
    
     update a 
    
     set a.c3=b.c3 
    
     ,a.c4=b.c4 
    
     from mytablea as a 
    
     join mytableb as b 
    
     on a .c1=b.c1 and a.c2=b.c2 
    
    Vsql: 
    
    Update mytablea 
    
    Set mytablea.c3=b.c3 
    
    ,mytablea.c4=b.c4 
    
    From mytableb as b 
    
    Where mytablea.c1=b.c2 
    
    And mytablea.c2=b.c2 

    6.vertica中没有bit类型,可以使用布尔替换,它创建索引的时候不能指定desc或asc,它默认是创建为升序的。Identity column不用指定数据类型, 现在会默认为bigint

    Create table mytable(rowid identity(1,1),rowname varchar(10))

    Looking for a job working at Home about MSBI
  • 相关阅读:
    MLPclassifier,MLP 多层感知器的的缩写(Multi-layer Perceptron)
    linux 内存不足时候 应该及时回收page cache
    关闭swap的危害——一旦内存耗尽,由于没有SWAP的缓冲,系统会立即开始OOM
    使用Networkx进行图的相关计算——黑产集团挖掘,我靠,可以做dns ddos慢速攻击检测啊
    ARIMA模型实例讲解——网络流量预测可以使用啊
    http://www.secrepo.com 安全相关的数据获取源
    什么是HTTP Referer?
    列举某域名下所有二级域名的方法
    HMM(隐马尔科夫模型)——本质上就是要预测出股市的隐藏状态(牛市、熊市、震荡、反弹等)和他们之间的转移概率
    成都优步uber司机第五组奖励政策
  • 原文地址:https://www.cnblogs.com/huaxiaoyao/p/3617142.html
Copyright © 2011-2022 走看看