The first thing to consider is its form - is it granulated or powdered? In the powdered form, it is Class II, Group G, T2 . It is potentially, but not necessarily, Class III in the granulated form. In any case it can burn, but only in the powdered form is it likely to be explosive. Note most granulated processes still produce some powdered sugar; the amount and housekeeping usually determine the level of hazard.
As usual, it doesn't mean that the granulated form can be ignored - even if it isn't Class II or III, but the protection techniques are usually different and it isn't subject to as many ignition sources. For example, static sparks can readily ignite powdered sugar in suspension, but it is usually more difficult with granulated. Typically, static discharge will melt and carbonize granulated sugar, but not actualy ignite it unless it is permitted to continue for a fairly long time since sugar has a high ignition temperature in either form.
NFPA 499, is the general Standard for classifying Class II materials and locations. It notes the many considerations that should be reviewed. It isn't a particularly long Standard - about 20 pages, a lot of which is reference tables and diagrams (but still read the text). It can be
reviewed on-line, but you should have someone familiar with both it and the packaging line process properly document the location. It's a requirement anyway [500.4(A)]